Thread safety of AAs
    Steven Schveighoffer 
    schveiguy at yahoo.com
       
    Thu May 17 08:12:11 PDT 2012
    
    
  
On Tue, 15 May 2012 22:35:17 -0400, Alex Rønne Petersen  
<xtzgzorex at gmail.com> wrote:
> Hi,
>
> Suppose that I have an AA that I'm doing lookups on from one thread, and  
> writing to in another. Is this safe at all?
No.
AA's are not a default-shared type.
If you need a counter-case, just consider that your adding thread does a  
rehash when you are traversing in your reading thread.
-Steve
    
    
More information about the Digitalmars-d-learn
mailing list