Michel Fortin Wrote:

> My opinion is that immutable and shared immutable should be two 
> different type modifiers. Contrary to other shared values, shared 
> immutable values can be cast to non-shared immutable (and non-shared 
> const) since they do not require memory barriers, but the reverse 
> should be forbidden (sending a non-shared immutable value to another 
> thread) because it would allow thread-local objects to escape.

You don't need the language to prevent the non-shared to shared cast as long
as the object can be moved to shared GC once it crosses the barrier.  The 
compiler
could do this when it sees the cast happening.

Jerry

Reply via email to