News for hackers. Stuff that matters.
Re:Async Rust Is A Bad Language by marcosdumay on Friday September 08, 2023 @01:06PM (#37436302)
Since that time, context switching changed from a O(log(n)) operation to an O(1) one.

I have no doubt that having a thread per core and managing the data with only non-blocking operations is much faster. But I'm pretty current machines can manage a thousand or so threads locked almost the entire time just fine.

Re:Async Rust Is A Bad Language by lossolo on Friday September 08, 2023 @01:12PM (#37436378)
> Since that time, context switching changed from a O(log(n)) operation to an O(1) one.

I'm not sure how that's relevant here, if for example something takes 1ms and I do it 1000 times a second, I'm using 1000 ms of CPU time vs not doing it at all. So if you want to use big o notation in this context it should be O(n) where n is the number of context switches, because you are not comparing algorithms used to switch between threads but you are comparing doing context switch or not doing it at all.