Before we get into the specific techniques for reproducing race conditions, let’s establish an overall strategy to guide how we approach the problem. Reproducing race conditions requires being able to carefully orchestrate the sequence of events in the critical section, preferably in a way that will not change when we fix the race condition. Understanding the exact nature of the race condition lets us understand the boundaries of the critical section and therefore the scope of our possible control of the execution. We are looking for the seams within the critical section.
In Listing 13-2, our race condition is bounded by testing for the
resource at line 2 and the assignment to