<div dir="ltr">`ThreadPoolExecutor` already allows a custom `ThreadFactory` to which you can pass `Executors.newVirtualThreadPerTaskExecutor()`. However, why would you create a new server using loom on thread/core when you want to rely on virtual threads? That just means that you are pooling virtual threads which seems to be pointless (basically you are creating a queue in order to put them in another). If you want to limit the number of concurrent access, then you can do that with a semaphore.<br><div><br></div><div>Attila</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Andrii Lomakin <<a href="mailto:lomakin.andrey@gmail.com">lomakin.andrey@gmail.com</a>> ezt írta (időpont: 2023. jún. 16., P, 7:59):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Good day devs!<div> I am considering the creation of a database server that is working on thread-per-core architecture. So I have a question: do you have plans to implement the possibility of using virtual threads executor on the base of a passed executor? </div><div><br></div><div>P.S. I am aware of problems with synchronization inside JDK classes, libraries, and pinned threads.<br><div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Best regards,<br>Andrii Lomakin.<br><br></div></div></div></div></div></div></div>
</blockquote></div>