Passing associative array to another thread

Johannes Pfau nospam at example.com
Sat Sep 22 04:50:08 PDT 2012


Am Sat, 22 Sep 2012 12:30:30 +0200
schrieb Jacob Carlborg <doob at me.com>:

> On 2012-09-22 11:24, Martin Drasar wrote:
> 
> > thanks for the hint. Making it shared sounds a bit fishy to me. My
> > intention is to pass some read only data, that are in fact thread
> > local and there is no real need to make them shared.
> 
> The whole point of thread local data is that it's only accessible
> from a single thread. If you want to share it with another thread you
> have, as far as I know, there options:
> 
> 1. Declare it as "shared"
There's also __gshared.

> 2. Declare it as "immutable"
> 3. Make a copy, i.e. serialize the data



More information about the Digitalmars-d-learn mailing list