That is a good and subtle point. On Fri, Apr 24, 2009 at 11:34 AM, sebb <seb...@gmail.com> wrote:
> 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.dunn...@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 <seb...@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-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > -- Ted Dunning, CTO DeepDyve 111 West Evelyn Ave. Ste. 202 Sunnyvale, CA 94086 www.deepdyve.com 858-414-0013 (m) 408-773-0220 (fax)