Question: 8. The code below is a thread program mutex. Answer the following questions: how many threads are created? Highlight and mark on the code. When
8. The code below is a thread program mutex. Answer the following questions: how many threads are created? Highlight and mark on the code. When thread start to execute, which function does it start to run? Describe the exccution logic of this program and the expected output. Modify the program so the execution order of the children threads will be reversed int valuc-1,234,5,6,7,8,9,10 int counter 10 pthread mutex t mutex -PTHREAD MUTEX INITIALIZER; int main int arge, char "argvL pthread t tid10 pthread attrtat10: fortintj- 0; J
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
