Can continuation support finally solve the "How do I stop this thread" problem?
Archie Cobbs
archie.cobbs at gmail.com
Fri Sep 2 15:15:02 UTC 2022
On Thu, Sep 1, 2022 at 11:42 PM David Holmes <david.holmes at oracle.com>
wrote:
> > So my question is simply what's the implementation distance between X
> > and Y? Where X = [We are now after implementing virtual threads], and Y
> > = [The ability to always unblock a blocked thread].
> >
> > For the sake of clarity let's assume whoever wants to do this is able to
> > rewrite bytecode (e.g., to add checks for a "stop" flag on backward
> > branches) to avoid infinite loops, etc., so the only real barrier is the
> > thread being stuck in a blocking method call.
>
> To which the only general solution is "only block using mechanisms you
> control and which are interruptible". There is no general solution to a
> blocking OS call unless the OS provides a mechanism to do so.
OK, it sounds like you're saying that there exists some system call X from
which we can't unblock a thread.
So what happens when a virtual thread invokes X? Isn't that going to "lock
up" the underlying platform thread (or whatever) while X is blocked?
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20220902/d19e135c/attachment.htm>
More information about the loom-dev
mailing list