Single Thread Continuation

Attila Kelemen attila.kelemen85 at gmail.com
Mon Jul 3 08:58:36 UTC 2023


Robert Engels <rengels at ix.netcom.com> ezt írta (időpont: 2023. júl. 3., H,
1:58):

> When you have virtual threads there is no need for generators - it is
> simply queues. The typical generator is simply implemented as a task that
> puts values on a queue with blocking semantics. The rest is syntactic
> sugar.
>
>
>
Though I never checked every detail on how virtual threads are implemented,
but your claim looks to be false to me. Consider that you are implementing
a normal `Iterator`, and then you don't read the iterator fully. In that
case, your virtual thread will be sitting in the scheduler forever waiting
to be unblocked, while this is not the case for reasonably implemented
generators.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230703/f8b2aa39/attachment.htm>


More information about the loom-dev mailing list