3 ms·
And this is why kernel developers find userland devs to be misguided so much of the time: thread creation is expensive. Thinking that you're saving resources b
by bcrl 5y ago
And this is why kernel developers find userland devs to be misguided so much of the time: thread creation is expensive. Thinking that you're saving resources by destroying "unnecessary" threads is not taking into account the system as a whole, especially when you're adding thread creation into what you probably assume is a fast path (waking up a thread in a thread pool).
<sigh>
- TYMorningCoffee 5y agoYou're right. At the time I did not consider the cost of creating and destroying the thread every ten minutes. Reflecting back on the problem with your comment in mind, the module I wrote could have expected the consumer pass in the thread pool, rather than the module managing it's own pool for something that runs every 10 minutes.
- pajko 5y agoThat's why green threads and fibers exist. Green threads implementation of Java has been removed a long time ago, but there's Project Loom: https://developers.redhat.com/blog/2019/06/19/project-loom-lightweight-java-threads# https://developers.redhat.com/blog/2019/06/19/project-loom-l...