[D-runtime] A mechanism to kill threads

Alex Rønne Petersen xtzgzorex at gmail.com
Wed May 16 16:26:49 PDT 2012


I agree. I'll have a go at implementing it and we can see where that goes.

Regards,
Alex

On Thu, May 17, 2012 at 1:22 AM, Sean Kelly <sean at invisibleduck.org> wrote:
> On May 16, 2012, at 4:06 PM, Alex Rønne Petersen wrote:
>
>> Trust me, I've evaluated every option I could think of. Even
>> cooperative suspension/killing won't cut it because a while (true);
>> inside a VM thread could prevent the cooperative kill from actually
>> happening at all.
>>
>> E.g.:
>>
>> void myThread()
>> {
>>    while (run)
>>    {
>>        runUserCode(); // if this never returns, the thread will never stop
>>    }
>> }
>
> Maybe a standalone function like:
>
> extern (C) int thread_terminateThread(Thread t);
>
> That would at least keep it out of the public interface for the object, and move it into the realm of really unsafe or weird stuff.  Obvious caveat still being that the app may well have been left in an invalid state.
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime


More information about the D-runtime mailing list