Re:It's not what programming languages do, it's what they sh...
by progre on Friday March 27, 2020 @03:05AM
(#22700908)
One fun class of bugs that occurs on 8-bit systems is when you have a 16-bit global variable (C makes this easy), and read access is actually 2 separate reads (one for each 8-bit part). This is invisable from the C code. Now lets say there is a separate thread or an interrupt that writes the variable in between the two read phases. Most of the time its fine, but every so often you get garbage (often double or half the value you expected).
[ Parent
| on HN ]
There are no comments on this comment yet.