Question: 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 following question asks you to consider a C program fragment.

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 ri = x; int r2 = y; } 50. What value(s) could (r1, r2) have when T2() completes? Select any that apply: (a) (0,0) (b) (0, 1) (c) (1, 0) (d) (1, 1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!