This program processes input lines using a multi-threaded pipeline consisting of four threads:
- Input Thread: Reads lines from standard input.
- Line Separator Thread: Replaces line separators (
\n) with spaces. - Plus Sign Thread: Replaces every pair of plus signs (
++) with a caret (^). - Output Thread: Writes processed data as lines of exactly 80 characters to standard output.
The threads communicate using producer-consumer buffers with mutual exclusion and condition variables.
To compile the program, ensure you have gcc installed on your system. Use the following command:
gcc -pthread -o line_processor line_processor.c