On Thursday 26 February 2004 23:36, Jonathan Hawkes wrote:
> Isn't copy-on-write broken along with double-checked locking (under the
> 1.4- memory model)?

I would be happy to see any references on this.

My typical code looks;

public void addMyListener( MyListener listener )
{
    synchronized( m_Listeners )
    {
        ArrayList clone = (ArrayList) m_Listeners.clone();
        clone.add( listener );
        m_Listeners = clone;
    }
}

public void removeMyListener( MyListener listener )
{
    synchronized( m_Listeners )
    {
        ArrayList clone = (ArrayList) m_Listeners.clone();
        clone.remove( listener );
        m_Listeners = clone;
    }
}

And I can't figure out how this could be faulty, even on exotic hardware.


Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to