Question: 49. Consider the possible values that r1 could have when T2 completes, and mark the following statement as true or false: Whether T1 runs T1A()

49. Consider the possible values that r1 could have when T2 completes, and mark the following statement as true or false: Whether T1 runs T1A() or T1B) does not change the possible values T2 can have in r1 when it completes. The following question asks you to consider a C program fragment. Threads T1, T2, and T3 concurrently run in the same address space and complete the functions with corresponding names. This question asks you about the state of the process after all threads have com- pleted. Note that x and y are allocated in the static data segment; you may treat them as if they are on the heap, and assume that they are aligned 32-bit words. int x = 0; int y = 0; void T1() { x = x + 1; } void T2() { y = y + 1; } void T3() { int r1 = x; int r2 = y; } a/What is the state of the process after all threads have completed? b/What value(s) could (r1, r2) have when T20) completes? c/ Tor F: Whether T1 runs T1A) or T1B0) does not change the possible values T2 can have in r1 when it completes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
