Making RCSlice and DIP74 work with const and immutable
Paolo Invernizzi via Digitalmars-d
digitalmars-d at puremagic.com
Mon Mar 2 00:15:00 PST 2015
On Sunday, 1 March 2015 at 15:53:07 UTC, Marc Schütz wrote:
> On Sunday, 1 March 2015 at 15:28:56 UTC, Jakob Ovrum wrote:
>> However, AFAICS, it comes with a serious problem. Immutable
>> objects are freely passable between threads, so surely an
>> immutable RC object would need atomic counting just like a
>> shared RC object, but unlike shared, immutable does not
>> necessarily express the intent of sharing between threads; the
>> immutable RC object could easily be counting atomically for
>> nothing.
>
> Argh! I didn't think about this. Any chance we can deprecate
> this behaviour? It's also an obstacle for the implementation of
> thread-local heaps.
No way! Neither for joke, please!
---
/P
More information about the Digitalmars-d
mailing list