A tarfile can be acquired here: lab5-handout.tar
sem_t
struct and friendsdining.c
-- the driver programphilosopher.{c,h}
-- philosopher class and related functionsconfig.h
-- configuration file -- you are welcome to change the times (in microseconds)table.{c,h}
-- table class and related functions.A table keeps track of the available resources (utensils).
table_checkin
is the function that will ultimately allow a philosopher to acquire its left- and right utensilstable_checkout
is the function that tells the philosopher to deposit their utensils back to the table (therefore, making them available to someone else)table
in the header file and source filetable.h
and table.c
as you see fit.NOTE: YOU WILL WANT TO IMPLEMENT ALL CHANGES IN table_checkin
BEFORE the code I wrote, NOT AFTER
Invoking make
will generate a binary ./dining
which requires three inputs:
N
-- the number of philosophers at the tableseed
-- seed to use for random number generationtime
-- time (in seconds) that the simulation should execute forThe program will report valid
or invalid
at the end
To suppress debug output:
make clean && NDEBUG=1 make
You can invoke make handin
to generate a handin.tar file. Upload/submit this file to autolab.
This lab will be graded out of 100 points. Please note: only 60 points is autograded
60pt
- Correct implementation Dining Philosophers20pt
- Performance evaluation (entirely based on within average of class)20pt
- Writeup