CPSC 330 - Spring 2009
Homework 6
Due by Wednesday afternoon, April 22
1. 1.14.4 (a)
2. 1.14.5 (a)
3. 1.15.1 (a) -- calculate the overall speedup two ways:
(i) ratio of addition of component times, and
(ii) Amdahl's Law with speedup s = 1.25
4. 5.16.1. (a) -- assume each thread has three relevant actions so
that the number of interleavings to consider is limited to 20
P1 P2
1.1 r1=x[0] 2.1 x[0]=2
1.2 x[0]=r1+1 2.2 r4=x[1]
1.3 x[1]=4 2.3 x[1]=r4+1
or at the assembly language level
P1 P2
1.1 ld r1,x 2.1 li r3,2 ; st r3,x
1.2 addi r1,r1,1 ; st r1,x 2.2 ld r4,x+4
1.3 li r2,4 ; st r2,x+4 2.3 addi r4,r4,1 ; st r4,x+4
5. 7.6.3
6. 7.7.1 -- note that this problem can be treated as if each statement
is executed indivisibly, so there are 24 interleavings to consider
(and you can simplfy the number of distinct outcomes even further
by observation of symmetries)
7. 7.7.2