return to UNIX

A producer-consumer pipeline synchronization using threads.

Program takes 2 parameters and runs 5 threads. The 1st thread reads data from the ASCII file (1st program's parameter) eliminates non-letters and reduces whitespace character sequences into single spaces. The 2nd one replaces every occurrence of the word (2nd parameter, must be at most 5 characters long) with the '$cut$' word. The 3rd one reverses characters in every second (odd) word and duplicates other (even) words. The 4th one reverses words in every line. The last one prints results to stdout. We can assume that input lines are no longer than 255 characters.

This task will be graded by Marek Kozłowski, please submit your solutions to /home2/samba/kozlowskim/unix/ folder.

return to UNIX