Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) The following shows two threads, Thread A and Thread B, to be run on supersca

ID: 3798419 • Letter: 1

Question

1) The following shows two threads, Thread A and Thread B, to be run on superscalar machine with 2 slots. Assume that before the code is run a, b, x and y are 0. Show how each would execute on Fine-Grained Multithreading. What are values of a, b, x and y at the end of Fine MT completion?

A1: x = y+5             B1: a = y+3

A2: a = b+7             B2: x = a+ y

A3: y = x*a              B3: x = b+7

A4: a=x+y               B4 : y = a+7

A5: x+=5

A6: a= y+7

A7: b = y+b

Time Thread A Thread B 1 A1 A2 B1 2 A3 B2 3 A4 B3 B4 4 A5 A6 A7

Explanation / Answer

A1: x= 5

A2: a = 7

x= 5

a= 3

A3: y= 15

B2: x = 18

x = 18

y = 15

a = 3

A4: a = 33

B3: x = 7

B4: y=40

x = 7

y = 40

a = 33

A5: x = 12

A6: a = 47

A7: b = 40

x = 12

y = 40

a = 47

b = 40

Time Thread A Thread B Values of variables 1

A1: x= 5

A2: a = 7

B1: a = 3

x= 5

a= 3

2

A3: y= 15

B2: x = 18

x = 18

y = 15

a = 3

3

A4: a = 33

B3: x = 7

B4: y=40

x = 7

y = 40

a = 33

4

A5: x = 12

A6: a = 47

A7: b = 40

x = 12

y = 40

a = 47

b = 40