www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Parallel safe associative array?

reply Andy Valencia <dont spam.me> writes:
I was playing with parallel programming, and experienced 
"undefined behavior" when storing into an Associative Array in 
parallel.  Guarding the assignments with a synchronized barrier 
fixed it, of course.  And obviously loading down your raw AA with 
thread barriers would be foolish.

But this set me searching through the library for a standard 
Associative Array construct which _is_ thread safe?  It didn't 
jump out at me.  I know I can place such a thing within a 
synchronized class, but I was wondering if there's a standard AA 
which has the standard usage but is safe when called in parallel?

Thanks,
Andy
May 24
parent mw <mw g.c> writes:
https://code.dlang.org/packages/rust_interop_d

wrapped:

DashMap: is an implementation of a concurrent associative 
array/hashmap in Rust.
May 24