News for hackers. Stuff that matters.
Re:Threads and Goroutines by gpderetta on Tuesday July 25, 2023 @12:07PM (#36864471)
Wouldn't you have exactly 1 thread per CPU for this sort of brute force embarrassingly parallel, CPU intensive computation? You should be context switch approximately never which makes coroutine vs thread moot.
Re:Threads and Goroutines by marcus0x62 on Tuesday July 25, 2023 @02:53PM (#36867519)
The point was more to see what the overhead is for CPU-bound tasks that do need to switch, not that this is the best approach for this particular task. I just happened to have the threaded version available, so I thought it made a good point of comparison.