CS 110 Intro to Computer Systems
Shared Memory Project
Due Date - Check Course Calendar
20 Points
Introduction
Convert the Monitor implementation of a ring buffer into an
implementation that:
-
Uses a shared buffer, Buf, of integers of size 12
-
Parent is to read from a file of 25 integers,
input.txt -
saving a copy
locally (you can read the whole file and then produce into the
buffer or save each value as you read it from the file).
-
The parent is to copy each integer into Buf,
tell the child a new integer has arrived, and sleep randomly for
one, two, or three seconds.
-
The child accesses Buf no faster than every two seconds.
-
The child prints each value out as it moves through the buffer,
but also stores a local copy.
-
When the child is finished (it knows there are a max of 25 values),
it prints out the array of integers.
-
Once the file is empty, the parent waits for the
child to die and then prints out the original 25 integers.
Stuff you NEED to Know/Do
-
You are to collaborate in groups of
two.
We will NOT assign partners,
find someone who is willing to discuss the project,
your code, etc.
Of course,
each of you
is to write your own code.
Use your partner to help debug and
test your solution.
This means that you MUST contact your partner first prior to
sending help requests to the graders or tutors or cs staff.
Indicate your partner in your code comments.
-
Look at multi
a new debugger.
Stuff you need to Turn-in and Submit
-
Turn-in (bin outside mike's office):
-
a copy of your commented program
-
and a script file of its execution.
-
Make sure to highlight the printouts to show parent
and child.
We do NOT need your Makefiles.
-
Submit
-
Submit your source code by running 'cs110submit'
This is Project 04.
Again, we do NOT need your Makefiles.
Last modified Feb, 16 by mike@cs.hmc.edu