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.

Os theoretical presentation


Published on

Operating Systems Team OS-Project-Eva

Published in: Education, Technology, Spiritual
  • Be the first to comment

  • Be the first to like this

Os theoretical presentation

  1. 1. OperatingSystemsFirstTheoreticalAssignment<br />Team OS-Project-EVA<br />Emmanuel Alejandro García Solís - 1450138<br />Maximiliano Hernández Castillo - 1453557<br />Adán de Jesús Silva Cuéllar - 1462847<br /><br />
  2. 2. NachOS (Version and Language Selected)<br />Wechoose C++ as programminglanguage.<br />The version of NachOS in whichwe are workingis the 3.4<br />
  3. 3. Deadlocks<br />Removing the mutual exclusion condition means that no process may have exclusive access to a resource. <br />Another way is to require processes to release all their resources before requesting all the resources they will need. This too is often impractical.<br />
  4. 4. -A "no preemption" (lockout) condition may also be difficult or impossible to avoid as a process has to be able to have a resource for a certain amount of time, or the processing outcome may be inconsistent or thrashing may occur.<br />-The circular wait condition: Algorithms that avoid circular waits include "disable interrupts during critical sections", and "use a hierarchy to determine a partial ordering of resources"<br />
  5. 5. How to detect and eliminate deadlock in the dining philosophers problem. <br />Everytime a philosopher has a fork, waits a random time toget the secondfork. If the secondforkisnotavailable in that time, release the forkthat he already has, and waitsfor the twoforksagain. <br />If a philosopherAreleaseonefork (cause he has already ate or he has waitedtoolongfor a fork) and stillhungry, putshim back into the queuetogetthatforkagain. If the philosopheradjacent B was already in the queue to get that fork (is hungry) takes it and begins to eat, if he doesn’t, philosopher A takes the fork back again. <br />It’simportantthat the wait time israndom, otherwise, the systemwillcrash.<br />
  6. 6. Our solution for dining philosophers<br />Methods used as threads are not allowed by nachOS, it just allows functions, so, we have to use just static functions and global variables.<br />We used matrix (matrices) to represent every hungry philosopher, his left fork (lock) and his right fork.<br />
  7. 7. If a philosopher has one fork (lock), and is hungry, looks for the second fork with tryAcquire(), if doesn't succeed, he sleeps until another philosopher wake him up. If a philosopher acquires the two forks, eat until a satiety counter reaches it’s maximum capacity, once he is satisfied, releases his two forks and sends a signal to wake up his neighbors.<br />