Passing associative array to another thread
Jonathan M Davis
jmdavisProg at gmx.com
Sat Sep 22 04:19:22 PDT 2012
On Saturday, September 22, 2012 12:30:30 Jacob Carlborg wrote:
> Looking at your original example I don't understand why the immutable aa
> won't work. That's the whole point of immutable, it's safe to share
> among threads. It's probably a bug somewhere. I think someone else can
> answer these questions better than me.
The problem with immutable is probably due to this bug:
http://d.puremagic.com/issues/show_bug.cgi?id=5538
And casting to shared probably won't work due to this bug:
http://d.puremagic.com/issues/show_bug.cgi?id=6585
std.variant needs quite a bit of work done to it, and it's causing problems
with std.concurrency is this case. In the interim, I suspect that just about
the only way to get an AA across threads is to just make it shared and not use
std.concurrency at all, as undesirable as that may be. Your serialization
suggestion would probably be the only other choice, though that would require
something like Orange, as Phobos doesn't have such facilities.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list