Process Synchronization using Pipes



Hey,

I need to have 4 processes: Producer, Filter1, Filter2 and Consumer.
Producer needs to read data from an input file line by line and pass
each line via a pipe to Filter1 who will replace all " " w/ "*". Once
Filter1 is done it will pass the newly modified line to Filter2.
Filter2 converts all lowercase letters to uppercases. Once Filter2 is
done it will pass the newly modified line to Consumer who simply
writes the line to an output file. This is repeated until the input
file is completely scanned.

I can get this to work w/ one line (no loops), so the first line of
text is completely converted but how do I get a while() loop to work
with this pipe synchronization so that the entire input file is
scanned?

I'd appreciate it if someone can help.

.



Relevant Pages

  • Re: Process Synchronization using Pipes
    ... I need to have 4 processes: Producer, Filter1, Filter2 and Consumer. ... Producer needs to read data from an input file line by line and pass ...
    (comp.unix.programmer)
  • Re: Process Synchronization using Pipes
    ... Producer needs to read data from an input file line by line and pass ... Filter1 is done it will pass the newly modified line to Filter2. ... where Producer forks to Filter1 whom forks to Filter2 whom forks to ...
    (comp.unix.programmer)
  • Re: Process Synchronization using Pipes
    ... Producer needs to read data from an input file line by line and pass ... Filter1 is done it will pass the newly modified line to Filter2. ... where Producer forks to Filter1 whom forks to Filter2 whom forks to ...
    (comp.unix.programmer)
  • Re: Process Synchronization using Pipes
    ... Producer needs to read data from an input file line by line and pass ... Filter1 is done it will pass the newly modified line to Filter2. ... int main (int argc, char* argv) ... /* status variables are used with _exit() and wait, ...
    (comp.unix.programmer)