Question: In JAVA I need help with the coding portion of the following. Command line execution: java cs280a1.hw2.Memory 1.1 Task 1 The first task involves contrasting
In JAVA I need help with the coding portion of the following.
Command line execution: java cs280a1.hw2.Memory

1.1 Task 1 The first task involves contrasting the performance of programs with and without caching. In particular, you will be working with the volatile keyword in Java. The volatile keyword informs the compiler that the variable should not be cached and accesses should always go to main memory. To profile the impact of caching, you will be contrasting the performance of loops when the loop variable is marked volatile and when the volatile keyword is not used for the loop variable. Your loop will maintain a running total of the addition and subtraction operations using the loop variable. The choice of whether you perform an addition or subtraction to the runningTotal is based on whether the loop variable is odd or even for the given iteration. If the loop variable is even (e.g., 10) then you should add the loop variable to the runningTotal; if the loop variable is odd (e.g., 37) then you should subtract the loop variable from the runningTotal. To cope with potential overflows/underflows runningTotal should be a long variable type. For
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
