Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ANN] coThreads 0.10
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-09-18 (00:35)
From: Zheng Li <li@p...>
Subject: Re: [ANN] coThreads 0.10
skaller <> writes:
> On Tue, 2007-09-18 at 00:37 +0200, Zheng Li wrote:
>> For immutable value, it's not different from the traditional threads, at least
>> from the library users' point of view: if a variable is already inside the
>> scope of a threads (i.e. it's global and created before launching the thread),
>> there is no necessity to message passing it; if not, you should anyway do it
>> explicitly even with the traditional threads.
> Yes, however such a value can't be shared by parallel control paths
> (in ocaml) because the collector won't allow it. Of course
> you can *copy* it eg with fork() and run separate collectors.
Given that the copy-on-write strategy is widely adopted in the *nix family, I
hope it's not a big problem.
> Then the functional value is the same, but the object identity
> (machine address) may differ.
Yes. For immutable value, physical equivalence is not preserved across
*multiple* rounds of message passing. This is another slight semantic
difference I should document on the pitfall page. As mutable value, if shared
through STM, their inter-references are actually preserved.

Zheng Li