Passing associative array to another thread

Martin Drasar drasar at ics.muni.cz
Fri Sep 21 07:33:10 PDT 2012


Hi,

I am using the std.concurrency module and I would like to send an
associative array to another thread.

If I try this:

string[string] aa;
someThread.send(aa);

I get: Aliases to mutable thread-local data not allowed.

And if I try to use this:

immutable(string[string]) aa;
someThread.send(aa);

I get:
/usr/include/d/dmd/phobos/std/variant.d(539): Error: *p is not mutable

which is because the send() creates a Message struct that stores the
data in a Variant.

And now I am stuck, because I do not have any idea what to do. Any advice?

Thanks,
Martin


More information about the Digitalmars-d-learn mailing list