Answer the following questions about the pseudo code below:…
Answer the following questions about the pseudo code below: Function thread1_func: Lock m1 Sleep for 1 second Lock m2 // Do work Unlock m2 Unlock m1 Function thread2_func: Lock m2 Sleep for 1 second Lock m1 // Do work Unlock m1 Unlock m2 1-What is the likely outcome if both threads attempt to lock the second mutex? [ans1] 2-Implementing a lock ordering strategy in the provided pseudocode would help to prevent deadlock. [ans2]
Read Details