Your assignment is to write a Unix/Linux program that mimics this Win32 demo program. When you run this program, it prints a steady stream of 0's in the console window. If you enter any integer value using the keyboard, as soon as you hit the Enter key the program will stream the new integer value in the console window. Every time you enter a new integer value, the program changes to print that new value. So this program is "concurrently" reading from the keyboard and printing to the console window. It is pretty easy to implement this program using threads (in fact, the demo version is implemented using Win32 threads). As a practice problem, you should write the threaded version of this program. But your assignment is to implement this program using Unix/Linux processes (not threads). So there should be one process to do the keyboard reading and one process to do the console writing. And there must be an interprocess communication mechanism.
Your program should use
You can write this program on Windows using Cygwin.
This assignment is due Thursday, September 7. |