Assoc Array for Concurrency

Chris via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Feb 29 04:43:39 PST 2016


What's the best way to make an assoc array fit for 
multi-threading? If this is not possible what would be the best 
alternative?

Say, for example, `data` is used by a class that is globally 
accessible to all threads. E.g. like this:

string[string] data;  // defined somewhere

public string getData(string key)
{
   if (key in data)
     return data[key];
   else
     return "";
}


More information about the Digitalmars-d-learn mailing list