Creating immutable data and sharing it

Lutger lutger.blijdestijn at gmail.com
Tue Sep 21 11:03:29 PDT 2010


Steven Schveighoffer wrote:

> On Tue, 21 Sep 2010 05:17:10 -0400, Lutger <lutger.blijdestijn at gmail.com>
> wrote:
> 
>> I'm still a bit fuzzy on how to create immutable data and when said data
>> is safe
>> to share across threads.
>>
>> To begin with, there is .idup, string literals and constructors of
>> immutable
>> objects. Those can be safely shared, no problem, right?
> 
> idup is not safe (along with dup), it is the equivalent of a cast right
> now.  You must still ensure the data has no aliases, or the data idup'd
> consists of all value types.
> 
> See this bug report: http://d.puremagic.com/issues/show_bug.cgi?id=3550

Good to know, I voted for it. There are quite a few bugs related to this topic, 
looks like I have some more studying to do.


More information about the Digitalmars-d-learn mailing list