Lab 11: The /proc Filesystem

In this lab, we will learn about the /proc filesystem. We will use the /proc filesystem to detect deadlock in an instance of the dining philosopher's problem.

Issues addressed by this lab include:

 

Lab Materials
  1. Slides
  2. Lab Files
  3. Video Discussion



Assignment

For this lab, you need to complete the implementation of the dine program. This program behaves identically to the program we saw in Dining Philosophers lab, but instead of using global state to detect deadlock, we will use information from the /proc filesystem.

We should be able to build the program using a Makefile submitted with your solution. An example output of running dine is shown below:

	 [gumapath-$] ./dine 

	 User time:	169 / 169	178 / 178	210 / 210	191 / 191	201 / 201	
	 System time:	5 / 5		5 / 5		8 / 8		7 / 7		5 / 5		
	 
	 User time:	156 / 325	125 / 303	170 / 380	166 / 357	178 / 379	
	 System time:	9 / 14		7 / 12		6 / 14		6 / 13		7 / 12		

	 User time:	146 / 471	171 / 474	192 / 572	155 / 512	171 / 550	
	 System time:	8 / 22		8 / 20		7 / 21		5 / 18		5 / 17		
	 
	 User time:	152 / 623	187 / 661	199 / 771	155 / 667	174 / 724	
	 System time:	4 / 26		7 / 27		7 / 28		5 / 23		5 / 22	

 

Submission

Before submission, please make sure that your code is running on the cycle servers.

Once you are done with the lab, please use the "Make zip" target in the Makefile. Please remember to replace the Xs at the top of the Makefile with your KUID. Submissions should be through Canvas.


This is an optional replacement lab. Submitting it allows you to replace the lab with your lowest score. Participation is not mandatory.


Evaluation


< Back to the Lab Home Page