Assuming the Java memory model, (a) Explain why it is not sufficient in Figure 13.11 to label X and Y as volatile. (b) Explain why it is sufficient, in that same figure, to enclose C’s reads (and...

Assuming the Java memory model, (a) Explain why it is not sufficient in Figure 13.11 to label X and Y as volatile. (b) Explain why it is sufficient, in that same figure, to enclose C’s reads (and similarly those of D) in a synchronized block for some common shared object O. (c) Explain why it is sufficient, in Example 13.31, to label both inspected and X as volatile, but not to label only one. (Hint: You may find it useful to consult Doug Lea’s Java Memory Model “Cookbook for Compiler Writers,” at gee.cs.oswego.edu/dl/jmm/cookbook. html).






May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here