News for hackers. Stuff that matters.
Re:Show HN: Bringing multithreading to Python's async event ... by m11a on Thursday October 03, 2024 @01:11PM (#41732674)
If I understand correctly, it sounds like the idea is to map N tasks to M threads.

I suppose it’d only really be useful if you have more tasks than you can have OS threads (due to the memory overhead of an OS thread), then maybe 10,000 tasks can run in 16 OS threads.

If that’s the case, then is this useful in any application other than when you have way too many threads to feasibly make each task an OS thread?

Re:Show HN: Bringing multithreading to Python's async event ... by nbsande on Friday October 04, 2024 @12:02AM (#41737700)
The idea is to map N tasks to M threads. This is useful more than just when you needd more threads than the OS can spin up. As you scale up the number of threads you increase context switching and cpu scheduling overhead. Being able to schedule A large number of tasks with a small number of threads could reduce this overhead.