First big PITA in reallife D project

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 19 12:41:42 PDT 2010


On 10/19/10 13:59 CDT, Kagamin wrote:
> Andrei Alexandrescu Wrote:
>
>> Terminating threads has always been iffy in all languages that use
>> native threads. I've discussed with Sean a couple of times about
>> ways to define a little protocol and API for orderly thread
>> termination. We need something like a callback mechanism -
>> atShutdown().
>
> Why? Just call delete on the thread object and in destructor do
> everything you want to put in atShutdown.

The problem with that is that it scales bad when you have many threads - 
the last thread stopped would have to wait for all others to stop.

Andrei


More information about the Digitalmars-d mailing list