/* Filename: NonBlockingAtomicReference.java, * STUDENT must implement this class. ************************************************************ Author: Dr. Parson Student co-author: Major: Professor Creation Date: 2/23/2024 Due Date: 3/28/2024 after spring break Course: CSC543 spring 2024 Professor Name: D. Parson Assignment: #3 Interface INonBlockingTupleExchange for NonBlockingQueue, NonBlockingAtomicReference, and NonBlockingAtomicReferenceArray implementing classes. */ package CSC543s24NonBlockingDataflowAssn3 ; import net.jcip.annotations.* ; import java.util.concurrent.atomic.AtomicReference ; // https://docs.oracle.com/javase/8/docs/api/index.html?java/util/concurrent/atomic/AtomicReference.html public class NonBlockingAtomicReference implements INonBlockingTupleExchange { /* TupleType will be FiveTuple or TenTuple in this assignment. */ public NonBlockingAtomicReference(AtomicReference q) { // STUDENT 2 (15%): Tag class as @ThreadSafe, store constructor // parameter or parameters in thread-safe fields, // and implement spinUntilPut and spinUntilTake as // described in interface INonBlockingTupleExchange and below. } public void spinUntilPut(TupleType tuple) { /* * spinUntilPut spins until it succeeds in calling non-blocking * successful insertion into an AtomicReference * via compareAndSet(). */ } public TupleType spinUntilTake() { return null ; // STUDENT Delete this line when you code this class. /* * spinUntilTake spins until it succeeds in calling non-blocking * successful retrieval from an AtomicReference * via getAndSet(). */ } }