A lightweight thread is a Thread

Alan Bateman Alan.Bateman at oracle.com
Wed Oct 23 20:12:51 UTC 2019


On 23/10/2019 20:29, David Lloyd wrote:
> Alan, did you have any thoughts about how thread interruption might
> work with lightweight threads?  I imagine that it wouldn't have to be
> too terribly different in a lightweight thread compared to "normal"
> threads, but I'm thinking that there is definitely a scheduling effect
> as interrupt tends to imply a wakeup/unpark in most if not all cases,
> and there is also a question of whether or how an LWT (to attempt to
> coin an abbreviation) interrupt would propagate to its scheduling
> thread (and in whatever way that relationship is defined to work).
They have an interrupt status, interrupt will set the status and unpark 
the thread. So locking, I/O operations, Object::wait, and everything 
else that reacts to interrupt should work. I saw one of your mails where 
you mention overriding the interrupt method. At things stand, 
propagation of the interrupt status to the carrier thread has to bypass 
the override, otherwise there is potential to run arbitrary code at 
sensitive times (e.g. mounting).

-Alan


More information about the loom-dev mailing list