Re:Nine ways to break your systems code using volatile
by kazinator on Friday October 06, 2023 @11:21AM
(#37791983)
This existed before threads were introduced into the C language. It's only about a single threaded program being interrupted by signal, which is in the same thread obviously.
The sig_atomic_t type that is specified for that purpose and must be used, which rules out the uncertainty you're referring to in (1). It is not a type qualifier but a specifier.
1. Larger than word size variables
2. Out of order CPUs
3. On multicore CPUs when another core handles the signal
Atomics must be used here for proper synchronization, when they are available. If not, architecture-specific mechanisms should be used.