[External] : Re: Single Thread Continuation

Andrew Haley aph-open at littlepinkcloud.com
Tue Jul 11 13:37:41 UTC 2023


On 7/5/23 13:09, Ron Pressler wrote:
> When the reference to the generator is dropped it can be collected (this is how it works for iterators and streams, too).

Yes, but while it can be it may not be, and this is a real problem if the
generator holds a scarce resource. We really do need to be able to close the
consuming side of a generator in such a way that we interrupt the generating
thread, allowing it time to release resources. Do we need something like a
closeable Iterator?

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the loom-dev mailing list