[D-runtime] A mechanism to kill threads

Artur Skawina art.08.09 at gmail.com
Fri May 18 06:49:30 PDT 2012


On 05/18/12 14:46, Fawzi Mohamed wrote:
> Now imagine you suspend or kill a thread while the spinlock to the
> common pool of fat locks is being held in the kernel...

If a thread can be killed while in kernel mode and all kernel-acquired 
resources aren't freed, then it's a kernel bug. Period.
If some /userspace/ system library does that kind of "optimizations",
that's a bit different, but still at least means a proper safe API is
missing.

He could setup a timer to periodically check for a 'kill-me' flag, but
that probably means relying on the user-code to not actively fight against
it (i don't know if it's an issue; as "VM" was mentioned maybe it isn't)
and if signals are allowed to interrupt the critical regions then that
alone won't be enough.

artur


More information about the D-runtime mailing list