






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Process coordination using shared memory and busy waiting, focusing on mutual exclusion and the critical section problem. It covers various algorithms like dekker's and peterson's, as well as semaphores and their implementation. The document also discusses alternative methods for mutual exclusion without shared memory.
Typology: Slides
1 / 30
This page cannot be seen from the preview
Don't miss anything!
/* Variables are global and shared / for (; ;) { // process 2 - an infinite loop to show it enters // CS more than once. Turn is initially 1. p2wants = 1; while (p1wants == 1) { if (turn == 1) { p2wants = 0; while (turn == 1) {/ Empty loop */} p2wants = 1; } } critical_section(); turn = 1; p2wants = 0; noncritical_section(); }
/* Variables are global and shared / for (; ;) { // process 1 - an infinite loop to show it enters // CS more than once. p1wants = 1; turn = 2; while (p2wants && turn == 2) {/ empty loop */} critical_section(); p1wants = 0; noncritical_section(); }
/* Variables are global and shared / for (; ;) { // process 2 - an infinite loop to show it enters // CS more than once. p2wants = 1; turn = 1; while (p1wants && turn == 1) {/ empty loop */} critical_section(); p2wants = 0; noncritical_section(); }