List of Figures

Chapter 2. The principal structure of a program

Figure 2.1. Execution of a small program

Chapter 7. Functions

Figure 7.1. Recursive call gcd2(18, 30)

Figure 7.2. Recursive call fib(4)

Chapter 8. C library functions

Figure 8.1. Time conversion functions

Chapter 10. Organization and documentation

Figure 10.1. Documentation produced by doxygen

Chapter 12. The C memory model

Figure 12.1. The different levels of the value-memory model for an int32_t. Example of a platform that maps this type to a 32-bit signed int that has two’s complement sign representation and little-endian object representation.

Chapter 15. Performance

Figure 15.1. Frequency histogram for our sample, showing the frequency with which each of the measured values was obtained

Chapter 17. Variations in control flow

Figure 17.1. Control flow of function calls: return jumps to the next instruction after the call.

Figure 17.2. Control flow with setjmp and longjmp: longjmp jumps to the position marked by setjmp.

Figure 17.3. Control flow after an interrupt return jumps to the position where the interrupt occurred.

Chapter 18. Threads

Figure 18.1. Control flow of the five threads of B9

Figure 18.2. A screenshot of B9 showing several cells and the cursor position

Figure 18.3. Control flow managed by mutex L->mtx and condition variable L->draw between the input and draw threads. Critical sections are shaded with grey. The condition variable is associated with the mutex until the waiter has reacquired the mutex.

Figure 18.4. Control flow of the five threads of B9-detach. The thread that returns last executes the atexit handlers.

Chapter 19. Atomic access and memory consistency

Figure 19.1. Two threads that synchronize via an atomic. The circles present the modifications of object x. The bars below the threads represent information about the state of A, and those above represent information about the state of B.

Figure 19.2. Two threads with three critical sections that synchronize via a mutex. The circles present the modifications of object mtx.

Figure 19.3. Sequential consistency for three different atomic objects

Figure 19.4. Hierarchy of consistency models, from least to most constraining