Example usage of the core.sync classes

Matt via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 2 09:39:18 PST 2015


I'm trying to write a small 3D engine, and wanted to place the 
physics in a separate thread to the graphics, using events, 
possibly std.concurrency, to communicate between them.

How, then, do I pass large amounts of data between threads? I'm 
thinking the physics world state (matrix for each object, object 
heirarchies, etc) being passed to the graphics thread for 
rendering.

I'd assumed that I would use Mutex, or ReadWriteMutex, but I have 
no idea how to build code using these classes, if this is even 
the right way to go about this.

I would really appreciate any pointers you can give.


Many thanks


More information about the Digitalmars-d-learn mailing list