Hello, In a few places in Chapter 4 it is mentioned that a certain access pattern is safe in a single-threaded program. In many (most?) Unix-like operating systems signal handlers in an otherwise single-threaded process execute in the context of that single thread. Nevertheless the signal handler represents a conceptually separate stream of execution that is subject to similar race conditions as those that occur in "true" multi-threaded programs. The situation is even worse with signal handlers as standard locks typically cannot be used to protect the access to shared data. It may be worthwhile to mention this pitfall. Also, a small typo in "Shared-Variable Shenanigans": --- a/toolsoftrade/toolsoftrade.tex +++ b/toolsoftrade/toolsoftrade.tex @@ -1550,7 +1550,7 @@ Of course, where practical, the primitives described in Section~\ref{sec:toolsoftrade:Atomic Operations (gcc Classic)} or (especially) Section~\ref{sec:toolsoftrade:Atomic Operations (C11)} -should be instead be used to avoid data races, that is, to ensure +should instead be used to avoid data races, that is, to ensure that if there are multiple concurrent accesses to a given variable, all of those accesses are loads. --Elad