Resource Constrained Thread Per Task Executor
Attila Kelemen
attila.kelemen85 at gmail.com
Mon May 13 21:41:11 UTC 2024
If you are wrapping another `ExecutorService`, then you don't really need
to have anything special for `shutdown` and such. You just have to delegate
those calls.
As for "is it safe to keep a virtual thread for an extended period of
time": Yes, it is safe, but pooling VT defeats its purpose.
Colin Redmond <Colin.Redmond at outlook.com> ezt írta (időpont: 2024. máj.
13., H, 23:34):
> Thanks for the idea, the AbstractExecutorService would be a great
> starting place, and that means I need to implement all the shutdown logic.
> Which is manageable, but tricky. I guess the moral of the story is there is
> no easy way out of the box to implement constrained resources with new
> thread per task executors. I will have to write some code and reimplement
> some things to get what I want.
>
>
> But maybe someone can answer me the question: is it safe to keep a virtual
> thread for an extended period of time? Maybe I can live with my
> ThreadPoolExecutor solution if it is safe. For my use case it works, but it
> isn't ideal.
>
> Thanks all for the feedback!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240513/b4df796d/attachment.htm>
More information about the loom-dev
mailing list