Sharing unlocked, unchanging data between threads?

Steven Schveighoffer schveiguy at yahoo.com
Wed Aug 11 06:09:36 PDT 2010


On Tue, 10 Aug 2010 14:53:18 -0400, Chris Williams <aahz at seanet.com> wrote:

> == Quote from Jonathan M Davis (jmdavisprog at gmail.com)'s article
>> Well, unless it's declared shared, it's going to be thread-local,
> and then each
>> thread is going to have their own copy. Now, if it were declared
> shared and you
>> never changed it after initially setting all of its values, then you
> shouldn't
>> have any problems as far as I'm aware. Just accessing an associative
> array
>> shouldn't change it.
>> - Jonathan M Davis
>
> I'm using D 1.0. I don't believe it has a "shared" keyword. But,
> globals are shared as well, I presume.

What runtime are you using, Tango or Phobos?  Because Phobos' D1 runtime  
has not had any TLC for a while.  It's quite possible there are some  
lingering bugs.

-Steve


More information about the Digitalmars-d-learn mailing list