www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14068] New: [AA] Concurrent access allowed

https://issues.dlang.org/show_bug.cgi?id=14068

          Issue ID: 14068
           Summary: [AA] Concurrent access allowed
           Product: D
           Version: D2
          Hardware: All
               URL: http://forum.dlang.org/post/vsvizmwxpjtbmasgdlsy forum
                    .dlang.org
                OS: All
            Status: NEW
          Keywords: accepts-invalid, spec
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: dfj1esp02 sneakemail.com

This compiles allowing concurrent modifications to AA:
---
shared string[string] t;
void main() {
    t["a"] = "b";
}
---

Though it doesn't look like AA is thread-safe.
And functions like
T rehash(T : shared Value[Key], Value, Key)(T aa)
can lead to believe it is.

It should be also documented whether AA is thread-safe
http://dlang.org/hash-map.html because there's no legible AA source to consult.

--
Jan 28 2015