Giter Site home page Giter Site logo

dining_philospher's Introduction

GROUP NUMBER: 16 Members : Naga Sai Bodepudi 140123011 Sai Teja Talasila 140123040 Charan Kesav Akkalla 140123004 Sujay Lakkimsetti 140123020

We have implemented using mutex and condition variables in pthreads library as suggested in Project 2 - The Dining Philosophers Problem of 
Chapter 6 of Text Book (OS)Concepts, Ninth Edition, Silberschatz, Galvin, Gagne) Pg. No. 301.
We have provided five outputs of my code in files attached.
Most of implementation is included in comments in DiningPhilosphers.c file.
compilation :
	gcc DiningPhilosphers DiningPhilosphers.c -pthreads
	./DiningPhilosphers

NO Deadlocks and Starvation have been detected for any number of eating times.


The Average hungry time obtained is :
output1 :
	 PHILOSPHER 1 ------------- 0.930000 
	 PHILOSPHER 2 ------------- 1.040000 
	 PHILOSPHER 3 ------------- 0.810000 
	 PHILOSPHER 4 ------------- 0.880000 
	 PHILOSPHER 5 ------------- 1.095000 
output2: 
	 PHILOSPHER 1 ------------- 0.840000 
	 PHILOSPHER 2 ------------- 0.950000 
	 PHILOSPHER 3 ------------- 0.980000 
	 PHILOSPHER 4 ------------- 0.915000 
	 PHILOSPHER 5 ------------- 0.840000 
output3:
	 PHILOSPHER 1 ------------- 0.825000 
	 PHILOSPHER 2 ------------- 0.975000 
	 PHILOSPHER 3 ------------- 0.855000 
	 PHILOSPHER 4 ------------- 0.795000 
	 PHILOSPHER 5 ------------- 0.965000  and etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.