This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: that uses the AtomicInteger class to provide lock-free access to the seed. Part 3 Modify the test driver so that it invokes each of these implementations in turn. Measure the performance of the two implementations by varying the number of threads that invoke the generator from within the driver. How does performance vary as contention increases? Contention is inversely correlated to the percentage of time spent performing thread-local computation. Part 4 Following our general description of implementing a lock-free queue, implement a non-blocking lock-free concurrent stack algorithm using the AtomicReference class to represent the top element in the stack. You need to provide operations to concurrently push and pop elements off the stack; since this is a lock-free algorithm, your solution should not involve the use of locks or synchronization (other than compareAndSet) ....
View Full Document
- Spring '08
- Data Structures, pseudo-random number generator, Non-blocking synchronization, Compare-and-swap