3 ms·
This post has the thesis that threads are expensive in some way. Modern OS's schedulers don't do work that's O(blocked threads) to schedule. They require a smal
by yuliyp 5y ago
This post has the thesis that threads are expensive in some way. Modern OS's schedulers don't do work that's O(blocked threads) to schedule. They require a small amount of memory to maintain some data structures to track it in the kernel, and some memory for a stack in userspace.
Threads as a mechanism for separating out the concerns that can run independent of each other is perfectly fine. While eventloops and thread pools are good, allowing for things like, say, a stats aggregator to not need to share a work queue with an application's work just makes for an easier-to-reason-about system.