Does D have equivalent of Java util.concurrent?

Dibyendu Majumdar d.majumdar at gmail.com
Sun Apr 28 09:05:27 UTC 2019


On Sunday, 28 April 2019 at 08:47:06 UTC, rikki cattermole wrote:
> On 28/04/2019 8:34 PM, Dibyendu Majumdar wrote:
>> I have to understand the model. Suppose some mutable data is 
>> passed around between threads. I don't really know as I 
>> haven't read this in detail - but my question is this: is 
>> there a cost to accessing data across threads?
>
> Same cost compared to C.

Is there a document that describes the rules regarding concurrent 
memory access, such as the Java Memory Model or C++ Memory Model 
(https://en.cppreference.com/w/cpp/language/memory_model)?

Suppose some data needs to be shared between threads, and it is 
not global data. Does it need to be marked 'shared'? Reading 
Andrei's doc I got the impression that the 'shared' mark has a 
cost.

Thanks


More information about the Digitalmars-d mailing list