Ephemeral threads

Viktor Klang viktor.klang at oracle.com
Sun Jan 11 16:34:38 UTC 2026


We've explored this in the past. Unfortunately it doesn't help, as it 
can observably change the behavior exhibited by code executed by such a 
thread.

On 2026-01-11 12:12, Michal Domagala wrote:
> Maybe a good idea would be `Thread.ofEphemeral()` ? Effort on JVM side 
> is minimal , because each non-tracked VT is ephemeral, everyone who 
> want experiment with ephemeral has an option, no one will comply about 
> semaphores, summoned demons, etc. because who consents cannot be injured
>
> sob., 10 sty 2026 o 18:18 Alan Bateman <alan.bateman at oracle.com> 
> napisał(a):
>
>     On 10/01/2026 16:00, Andrew Haley wrote:
>     >
>     You can summon other demons
>     when the threads act on objects with cleaners (or more generally,
>     anything with cleanup actions based on phantom refs). This can
>     lead to
>     cleaning actions that attempt to release resources in an inconsistent
>     state. Even if we spent a few years on the issues, the usage (to
>     allow
>     the alive threads be GC'ed) is very fragile to setup, and the
>     resulting
>     behavior would surely be surprising to most developers
>
-- 
Cheers,
√


Viktor Klang
Software Architect, Java Platform Group
Oracle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20260111/ce901a58/attachment.htm>


More information about the loom-dev mailing list