Comment

Comment by mholt

This is something I learned through the course of trying to be clever in my early days of using Go (circa 2011) and it's something I wish my CS courses made explicitly clear, and I think all programmers should at some point learn this difference. Even in JavaScript, race conditions are possible.

In fact, I'm pretty sure my car's "infotainment" system has several race conditions (though I'm not sure about data races specifically). After years of dealing with these kinds of bugs, you can smell them a mile away especially on software you use a lot. Symptoms: highly sporadic / unpredictable behavior of a wonky state machine. These are hard to document and debug!

My car, for example, will sometimes exhibit these behaviors:

- Volume changes Android Auto levels even though only music is playing

- Backup camera is not on anymore, but steering alignment overlay remains when side camera is activated

- Computer+screen stays on even though car is off

- Audio is quieted for a notification but then never returned to its previous volume

- Buttons change state as if the screen was showing something else

Race conditions are really common, I think. I know this is just my car as an example but you've probably experienced them on any moderately-complex systems you've used. I bet your TV has race conditions. And your router. And your ("smart") thermostat. I hope airplanes and spacecraft don't.

parent mholt 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton