[External] : Re: Virtual thread memory leak because TrackingRootContainer keeps threads
Alex Otenko
oleksandr.otenko at gmail.com
Thu Aug 1 10:11:36 UTC 2024
That doesn't seem to be sufficient to work. You can't GC the queue and not
GC VT at the same time. Since they reference each other, you can only
either keep both or GC both. So you can't have the smart close that is
based on reachability of queue.
On Thu, 1 Aug 2024, 10:49 Michal Domagala, <outsider404 at gmail.com> wrote:
>
>>
>> one might ask why the queue became unreachable without extra
>> communication, eg via interrupting the thread. You'd need to elaborate more
>> why that would be a perfectly good concurrent system, not just puzzle over
>> the contrived example
>>
>
> Answer is quite simple: queue became unreachable without extra
> communication because I want avoid extra communication, eg via interrupting
> the thread.
> I want producer and consumer be loosely coupled. They are connected only
> by blocking queue. When queue must be unreachable, it is enough that
> someone, for example consumer, producer or third actor makes the queue
> null. After that queue as well as consumer are GC'able
>
> All extra communication overhead is that producer must verify if *current
> *queue is not null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240801/648d1964/attachment.htm>
More information about the loom-dev
mailing list