CSE 131 Lecture 8: Lecture 8

45 views5 pages
28 Jan 2019
School
Course
Professor

Document Summary

We want to execute b in p1 only after a executes in p0. Use up() to notify p1 at the appropriate time. Value of semaphore specifies how many processes can be in the critical section. Only one process can be in the critical section. Value can range over an unrestricted range. Value 1 means the semaphore is available. Value 0 means a process has acquired the semaphore. Possible to implement one type using the other. A monitor is another kind of high level synchronization primitive. Only one process may be in the monitor at a time. Enforces mutual exclusion: better at avoiding programming errors. Variables belonging to monitor are protected from simultaneous access. Procedures in monitor are guaranteed to have mutual exclusion. This looks like c++ code, but it"s not supported by c++ Variables foo, bar, and arr are accessible only by func1 and func2. Only one process can be executing in either func1 or func2 at any time.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents