Page 1 of 1

11. One problem with process synchronization is when one action must occur before another action. Given the code below,

Posted: Fri May 20, 2022 1:04 pm
by answerhappygod
11 One Problem With Process Synchronization Is When One Action Must Occur Before Another Action Given The Code Below 1
11 One Problem With Process Synchronization Is When One Action Must Occur Before Another Action Given The Code Below 1 (44.84 KiB) Viewed 49 times
11. One problem with process synchronization is when one action must occur before another action. Given the code below, we want to guarantee that at happens before b2; and b1 happens before a2. Write the pseudocode for this problem. In writing your solution, be sure to declare and initialize the semaphore(s) or mutexe(s) that you need. Your solution must not result in deadlock. [5 points] // Global variables // Main Function int main() { startThread (threadA); startThread (threadB); } // Threads Function void threadA() { // Thread B Function void threadB() { 1 1 1 1 1 1 1 statement al; statement bl; statement a 2; statement b2; 1 1 } Figure 2: Program listing 2