Skip to content
Advertisement

Tag: inter-process-communicat

Linux-C: reading from pipe returns first buffer written to it

This program simulates a variant of Dijkstra’s Producer/Consumer problem. A pipeline is first created followed by a child process using fork(). The child will then write to the pipe a crudely done randomly generated piece of “stock market ticker information”. After waiting for the child/producer process to write this information, the parent/consumer process will read it out. The first output

Advertisement