3 ms·
Can you have leaks when everything is garbage collected? Do deadlocks occur if killable threads aren't allowed to wait for other threads?
by scotty79 2y ago
Can you have leaks when everything is garbage collected?
Do deadlocks occur if killable threads aren't allowed to wait for other threads?
- pjc50 2y agoYou 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.
- meindnoch 2y agoShared-nothing threads? So basically processes.
- meindnoch 2y agoJava 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/threadPrimitiveDeprecation.html https://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadP...