News for hackers. Stuff that matters.
Re:Threads, Threads, and More Threads by yuliyp on Tuesday March 22, 2022 @11:17PM (#30774483)
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.

There are no comments on this comment yet.