Parallel safe associative array?

Andy Valencia dont at spam.me
Fri May 24 17:06:05 UTC 2024


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



More information about the Digitalmars-d-learn mailing list