Shared memory programming B. Wilkinson Jan 3, 2015
What is a critical section? a. A section of code that cannot be removed. b. A section of code that takes the long time to execute and should be optimized. c. A section of code that only one thread is allowed to execute at a time. d. A section of code that must be correct. e. None of the other answers
Suppose there are two threads A and B, which may execute separately or together. What are the possible values for x after both threads have executed their code sequence below: Thread A Thread B x = 1; x = 1; x= x + 1; x = x - 1; 0 and 1 0, 1, and 2 1 and 2 0 and 2 None of the other answers
What is meant by the term “Jacobi” iteration as opposed to other types of iteration that are not Jacobi? (a) Each value is computed from the values of the same iteration. (b) Each value is computed from the values of the previous iteration. (c) Each value is computed from the values of the next iteration. (d) It is the Heat distribution equation (e) None of the other answers