I'm trying to make an AtomicReference class in C# and I want to keep the field reference protected, but I also need to return the value in the get method:
class AtomicReference
{
    private Object _value;
    public AtomicReference()
    {
        _value = new Object();
    }
    public AtomicReference(Object value)
    {
        Opt...
            
           
          
            
            In Java there exists an AtomicReference class.  Does this mean that setting a reference is NOT an atomic operation in and of itself?
e.g., is this not thread-safe (assuming that the value returned cannot be modified)?:
public void someMethod()
{
   this.someList = Collections.unmodifiableList(new LinkedList<Object>());
}
public List<O...
            
           
          
            
            Hi,
The atomic integer, long, boolean etc are used to do any atomic updates to the respective types since there may be a race condition when we execute any manipulation on them, e.g ++. But what are the different cases with references where there may be such race conditions?
Best Regards,
Keshav
...