Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's a sure way to get leaks and deadlocks.


Can you have leaks when everything is garbage collected?

Do deadlocks occur if killable threads aren't allowed to wait for other threads?


Java threads were killable originally. Then it turned out to be impossible to use safely, so it got deprecated: https://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadP...


You can probably make this work if and only if the thread is shared-nothing. If you share any data structure with another thread then you have the possibility of leaving it in an invalid state when killed.

This also requires any "channel" primitives you use for inter-thread communication to be tolerant of either thread being killed at any instruction boundary, which is hard to design.


Shared-nothing threads? So basically processes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: