Never Snooze a Future

(jacko.io)

12 points | by vinhnx 5 days ago ago

2 comments

  • cousin_it 3 minutes ago

    Looks like the code of foo() says "take a lock then sleep for 10 millis", but actually it can take the lock and then sleep forever, depending on how it's polled. Well! This seems like a bug with the async abstraction in Rust then. Or if you don't like "bug", then "disagreement with intuition that will cause bugs forever". Goroutines in Go don't have this problem: if a goroutine says it'll take a lock and sleep for 10 millis, then that's what it'll do.

  • ixxie an hour ago

    I thought this was a "carpe diem" motivational post xD