[External] : Re: Project Loom VirtualThreads hang

Ron Pressler ron.pressler at oracle.com
Thu Jan 5 23:01:59 UTC 2023



> On 5 Jan 2023, at 20:43, thurston N <thurston.nomagicsoftware at gmail.com> wrote:
> 
> "It is not hard to add time-sharing to virtual threads"
> 
> If so, how hard would it be to add *user-directed timesharing*. e.g.
> 
> VirtualThreads.yield(reschedule=LOW_PRIORITY) // a strong hint to scheduler to run other Continuations (that's other continuations not just other "tasks") before resuming current continuation
> 
> I don't know if that ameliorates Sam's specific situation or not, but it's not difficult to think of many circumstances that could benefit from such an ability.
> One of the core ideas of coroutines is cooperative multitasking, now I suppose one could rejoin with CONTINUATIONS ARE NOT COROUTINES, but so what? what's wrong with cooperative-multitasking continuations?
> 
> It's one thing not to have automated timesharing built into the scheduler (which I would think would be difficult to do well, but IDK), it's quite another to afford no opportunity for user-level  code to "control the scheduling" (how about "influence" or "affect" vis a vis "control"?)
> 
> This strikes me as a bit of a circular argument, viz. if your target/focus is workloads with a lot of *short-lived* tasks, then yeah, it's going to be difficult to conjure scenarios where automated timesharing will make any difference (in the extreme case where every task runs shorter than its allotted time quantum, then time-slicing can make no difference at all)
> 
> 
> -T


Custom schedulers are on the roadmap, and will probably not take long to arrive, but we need to focus the 99% use-case before turning our attention to the 1% use-case.

— Ron



More information about the loom-dev mailing list