Name: _____________________________ 6 Digit StudentID: ___ ___ ___ ___ ___ ___

Worksheet 21: Atomics

Given the documentation for AtomicInteger's get, compareAndSet, and incrementAndGet methods:

1) Write pseudocode for incrementAndGet() invoking only get and compareAndSet methods:

 

 

 

 

 

2) How would the code would perform under (high, medium, low) levels of contention?

Post Lecture

Synthesize today's class session

 

 

What is unclear?