Mastodon Feed: Post

Mastodon Feed

dysfun@treehouse.systems ("gaytabase") wrote:

spin loops are everywhere in real concurrency code. usually around locks, but not just. and we just do it like we're never going to get swapped out for literally milliseconds.

to me, part of the promise of async was that we could get away from all this locking and the associated spinning. but when you go look at e.g. rust async, async primitives that need to lock are just spinning forever and hoping that the slow case won't be too slow.

i can't really do anything to make the slow case faster, but i can just not burn cpu for a few milliseconds by filling it with other work.