Nigel Rantor wrote:
> 
> John Nagle wrote:
>>     Immutability is interesting for threaded programs, because
>> immutable objects can be shared without risk.  Consider a programming
>> model where objects shared between threads must be either immutable or
>> "synchronized" in the sense that Java uses the term.
>> Such programs are free of most race conditions, without much
>> programmer effort to make them so.
> 
> I disagree. They are not free of most race conditions, and it still
> takes a lot of effort. Where did you get this idea from? Have you been
> reading some Java primer that attempts to make it sound easy?

Read again what he wrote. In a language with only immutable data types
(which doesn't mean that you can't efficiently create modified versions of
a data container), avoiding race conditions is trivial. The most well known
example is clearly Erlang. Adding "synchronised" data structures to that
will not make writing race conditions much easier.

Stefan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to