1 / 5

While (lock = 1) wait Lock = 1 <critical section> Lock = 0

Explore advanced synchronization methods for efficient concurrency control in programming. Learn about critical and non-critical sections, locks, and turn-based strategies. Improve your understanding of concurrent programming techniques.

connieb
Download Presentation

While (lock = 1) wait Lock = 1 <critical section> Lock = 0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. While (lock = 1) wait Lock = 1 <critical section> Lock = 0 While (lock = 1) wait Lock = 1 <critical section> Lock = 0

  2. Loop1: While (turn != 1) wait <critical section> turn = 0 <noncritical section> GoToLoop1 Loop0: While (turn != 0) wait <critical section> turn = 1 <noncritical section> GoToLoop0

  3. Interested[0]=T Turn = 0 [While (Turn = 0) and (Interested[1]=T) Wait] <critical section> Interested[0] = F Interested[1]=T Turn = 1 [While (Turn = 1) and (Interested[0]=T) Wait] <critical section> Interested[1] = F

More Related