Write down a short C program and turn in source code and output printouts.
a. Write down a short C program which develops two processes. Each process must repeatedly write its own unique message to test file, one character at time. Do you see garbled messages in the file? Explain why or why not?
b. Add "#include " to program, and use usleep(1) and fflush(FILE *stream) calls between writes to individual characters. Do you see garbled messages in file? Explain why or why not?
c. Can you use lock file to coordinate these two processes so test file no longer contains garbled messages? Explain why or why not? Write your suppositions.
2. Write a creative/funny example of synchronization which can show difficulty of creating a solution similar to "Too Much Milk Solution 3." Ensure that you create your own corresponding solutions 1, 2, and 3, and vigorously explain the correctness and pitfalls of each solution.