Question: Consider the fopwing code, with the assumption that each executes in a separate thread: i = 0; // Shared by THREAD 1 and THREAD 2

Consider the fopwing code, with the assumption that each executes in a separate thread: i = 0; // Shared by THREAD 1 and THREAD 2 THREAD 1 THREAD 2 while( i -10) i++; printf( "a wins" ); printf("b wins" ); Is it guaranteed that someone wins? Explain. i--; a. b. Is it possible for someone to win? Explain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
