Question: Each Mutex object has two methods, Lock and Unlock, which are used to avoid deadlocks. Observe the above program and choose the lines in which



Each Mutex object has two methods, Lock and Unlock, which are used to avoid deadlocks. Observe the above program and choose the lines in which should we use these methods. a) Lock in line 19 and Unlock in line 26. For the mutex to protect all the operations executed inside the 1000 iterations. b) Lock in line 22 and Unlock in line 24. For the mutex to protect all the goroutines that are shared between the 100 iterations. c) Lock in line 11 and Unlock in line 13. For the mutex to protect the critical section. d) No need to use these methods for this program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
