. Version 0 -- Basic Logic
- Concept of inversions. Trace code
- What is expected output for different size?
Version 1 -- Add Threads
- Concept of Thread of execution
- Shared global/alloc, separate RTSs
- Design of ThreadMain
- Why does it fail? Note the order of output.
Version 2 -- Joins
- But, why does it produce different results each time?
- (And slow!, for subtle reasons we'll examine later)
- But, note the user/real time ratios. We're getting threading.
- But, as we increase thread count, we get bad inversion counts
Version 3 Synchronize
- Examining the counter increment; consider machine translation
- Walk through how an increment could be missed
-
Mutex operation
- System call
- Blocking without spin waiting
-
Concepts and terms
- atomic operation
- critical section
- race condition / data race
- mutex
- Correct now, but way slow. Why? Note system time.