Obedient threads

thedeemon via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 2 03:32:56 PDT 2014


Just use non-blocking receives in main thread's event loop. When 
you get a message from child thread that it's finished playing 
and you decide you don't need that thread anymore, send a message 
to child "you're dismissed". The child should also have some loop 
to check for incoming messages non-blockingly. Upon receiving 
such message it should exit.


More information about the Digitalmars-d-learn mailing list