A lightweight thread is a Thread

Ron Pressler ron.pressler at oracle.com
Mon Feb 3 08:50:36 UTC 2020

Virtual threads aren’t cooperative, but preemptive. While the default virtual thread scheduler probably won't use time-slice 
preemption (as it’s probably unnecessary and unhelpful), other custom schedulers could, and in any event preemptive != time-sharing.
See https://en.wikipedia.org/wiki/Preemption_(computing)#Preemptive_multitasking :

     The term 'preemptive multitasking' is sometimes mistakenly used when the intended meaning is more specific, 
     referring instead to the class of scheduling policies known as time-shared scheduling, or time-sharing.


On 3 February 2020 at 08:35:07, Christopher Hunt (huntchr at gmail.com(mailto:huntchr at gmail.com)) wrote:

> Thanks Alan. I missed that particular “thread”. ;-)
> “Virtual thread” is better, but I’m still wondering if “cooperative thread” vs “preemptive thread” is more descriptive...
> I also like how there’s no hierarchy of thread types also.
> Naming is hard. :-)
> > On 3 Feb 2020, at 17:56, Alan Bateman wrote:
> >
> > On 03/02/2020 02:28, Christopher Hunt wrote:
> >> Is “lightweight” descriptive enough if we are essentially discerning pre-emptive threads from cooperative ones, or kernel ones from user land ones? Would it therefore be more useful to introduce a hierarchy reflecting the scheduling nature nature of a thread?
> >>
> >> Also, as a term, “lightweight” tends to survive only until something more lightweight comes along.
> >>
> > The discussion thread "Virtual Threads: A Short Note about Naming" [1] and the Thread's updated class description in the current prototype [2] should help get you up to speed on this topic.
> >
> > -Alan
> >
> > [1] https://mail.openjdk.java.net/pipermail/loom-dev/2019-November/000864.html
> > [2] https://download.java.net/java/early_access/loom/docs/api/java.base/java/lang/Thread.html

More information about the loom-dev mailing list