commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [math] Mutable "Vector3D"
Date Fri, 24 Apr 2009 18:34:11 GMT
OK, that makes sense.

However, only objects that are immutable from construction are
thread-safe without needing some kind of synchronisation.

Passing it to a newly created thread would be OK (Thread.start() is
synch.), but if it is passed to an existing thread some other means of
synch. would be needed.

On 24/04/2009, Ted Dunning <ted.dunning@gmail.com> wrote:
> My view is that once it is immutable it is immutable.  Restoring mutability
>  is done by making a new copy and in the context of the applications I was
>  describing is essentially never done.
>
>
>  On Fri, Apr 24, 2009 at 10:39 AM, sebb <sebbaz@gmail.com> wrote:
>
>  > allow a programmer to make a mutable copy that
>  > >  is manipulated for a while destructively and then marked as immutable
>  > when
>  > >  it is exposed to the outside world.
>  >
>  > How does that work?
>  > Do threads have to get a shared read-lock or exclusive write-lock on the
>  > object?
>
>
>
>
>
> --
>  Ted Dunning, CTO
>  DeepDyve
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message