Question: Write a program with one thread function, define an array with 5 elements as a global variable [ use the file mutex2.c for this lab].
Write a program with one thread function, define an array with 5 elements as a global variable [ use the file mutex2.c for this lab]. Call the thread 2 times First for incrementing the array elements by 2. Second for incrementing the array elements by 3. Give a "sleep(2)" in the for loop of the thread function to model some process happening in between. Check if you are getting an expected output of incremented array elements.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
