Start named virtual thread

Alan Bateman Alan.Bateman at oracle.com
Wed Jul 26 16:59:09 UTC 2023


On 26/07/2023 17:46, Glavo wrote:
> Hi,
>
> There are times when I'm not happy with 
> `Thread.ofVirtual().name(xxx).factory()` and would like more 
> flexibility in naming virtual threads.
> Therefore, I would like to have an API method like this:
>
>     public static Thread startVirtualThread(Runnable task, String name)
>
>
> Can we provide such an API method?
>


It's easy to start a virtual thread with a name if you really want, e.g. 
Thread.ofVirtual().name("duke").start(task);, so I'm curious what 
problem or issue you are running into.

-Alan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230726/d215f1cc/attachment.htm>


More information about the loom-dev mailing list