Homework #1: A Reflective Judgement and writing Assignment

Assignment #7, IPC – threads
Dr. Dieter Otte, CS
CS 480
Goal of this Assignment:
Understanding how to use mutually accessible main memory. Understanding the implications of this.
Continue to program with threads and sync mechanisms.
You are supposed to create a program, which demonstrates the Bounded Buffer Problem in the
following way:
Your program will, after some initialization, have three processes.
Suppose that the main process (the “Writer” or the “Producer”) reads the contents of a text file (the
name of the file is passed as a command line argument). It puts the file’s contents piece-wise in onebyte increments into a buffer. The other two processes (the “Readers” or “Consumers”) read the
characters from that buffer and output them on the screen.
Needless to say: the writer and the readers have to be synchronized. And, the two readers writing to
the screen need to be synchronized as well.
You need to use the IPC means of the System V IPC package, specifically Shared Memory and
To be handed in:
Send in an electronic copy of the program. Use the extension “.c”. Make sure that the program is
structured well and heavily commented. Be prepared to explain the inner workings of and/or
demonstrate your program.
CS 480 Handout – Assignment #7
1 of 1