Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this


  1. 1. Operating Systems Assignment 1 Theorical Part Óscar Eduardo Silva Espinosa Daniel Alexis Donjuan González
  2. 2. How to solve unbounded-buffer producer-consumer wiht locks. producer while it's true acquire lock produce unity counter + + Condition call to lock release the lock consumer While it's true acquire lock while the counter is equal to 0 call waiting lock condition end consume the next unit counter - lock release
  3. 4. How to detect and eliminate deadlocks in the dining philosophers problem Check If the left fork is available, take it If the left fork is available, take it Eat Put the left fork down Put the right down If philosopher[ i ] is hungry and left and right philosopher are thinking Then take the fork
  4. 5. check{ var (i, temp) when i is less than the number of pholosophers { If the philosopher i is return true If the left and right philosophers have a fork temp++ i++ } If temp = number of philosophers return true }
  5. 6. Examle When you acquire resources (such as the Fork object) in ascending order, circular wait is impossible: for a circular wait to occur, some thread must be holding a higher numbered resource waiting for a lower numbered resource, but that is forbidden. We can use resource enumeration in the Dining Philosophers problem to eliminate deadlock.