On 2009-12-22 11:39:04 -0500, Jerry Quinn <[email protected]> said:

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.

Indeed. But you still need the compiler to treat immutable and shared immutable as two different things. Currently those are synonyms semantically.

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to