www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to write correct multi-threaded code?

I'm trying to write multi-threaded code that uses mutexes, 
condition variables and atomics but I've got confused how to do 
this correctly. Everything I found so far include a lot of 
casting to/from shared even for the objects that are supposed to 
be shared (like mutex and condition variable).

Is there any good explanation or guide with examples of how to 
write correct multi-threaded code in D using shared, 
synchronized, core.sync.* etc things?
Oct 16 2019