. Version 0 -- Basic Logic

  1. Concept of inversions. Trace code
  2. What is expected output for different size?

Version 1 -- Add Threads

  1. Concept of Thread of execution
  2. Shared global/alloc, separate RTSs
  3. Design of ThreadMain
  4. Why does it fail? Note the order of output.

Version 2 -- Joins

  1. But, why does it produce different results each time?
  2. (And slow!, for subtle reasons we'll examine later)
  3. But, note the user/real time ratios. We're getting threading.
  4. But, as we increase thread count, we get bad inversion counts

Version 3 Synchronize

  1. Examining the counter increment; consider machine translation
  2. Walk through how an increment could be missed
  3. Mutex operation
    1. System call
    2. Blocking without spin waiting
  4. Concepts and terms
    1. atomic operation
    2. critical section
    3. race condition / data race
    4. mutex
  5. Correct now, but way slow. Why? Note system time.