Hacker News new | ask | show | jobs
by pessimizer 2401 days ago
Web 4.0 is the internet of race conditions. Thanks, javascript everywhere.
2 comments

I don't get it. Javascript would have categorically improved on this compared to more traditional multi-threaded solutions.
You can still have race conditions in single-threaded async code.
Well I don't think that could technically be considered a race condition, as it's clearly a design problem in the code causing what would appear to be a "pseudo" race condition.
Why not? It is a race condition, just like TOCTTOU is a race condition that doesn't necessarily involve threads.

Note the difference between race conditions in general and data races that involve unsynchronized access to shared memory.

And “Javascript would have categorically improved on this compared to more traditional multi-threaded solutions” remains true nevertheless.
What? JavaScript is a single threaded language...
And despite this, I've encountered lots of race conditions in JavaScript, thanks to the magic of async programming. Harder to debug than multi-threaded ones, too.