This preview shows page 1. Sign up to view the full content.
Unformatted text preview: The origin of the graph corresponds to the initial state where none of the threads has yet completed an instruction. Figure 11.11 shows the 2-dimensional progress graph for the ﬁrst loop iteration of the badcnt.c program. The horizontal axis corresponds to thread 1, the vertical axis to thread 2. Point ´Ä½ Ë¾ µ corresponds to the state where thread 1 has completed Ä½ and thread 2 has completed Ë¾ . A progress graph models instruction execution as a transition from one state to another. A transition is represented as a directed edge from one point to an adjacent point. Figure 11.12 shows the legal transitions 11.4. SYNCHRONIZING THREADS WITH SEMAPHORES
Thread 2 577 T2 S2 U2 L2 H2 H1 (L1, S2) L1 U1 S1 T1 Thread 1 Figure 11.11: Progress graph for the ﬁrst loop iteration of badcnt.c. in a 2-dimensional progress graph. For the single-processor systems that we are concerned about, where instructions complete one at a time in sequentially-consistent order, legal transitions move to the right (an instruction in thread 1 completes) or up (an instruction in thread 2 completes). P...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American