An attractive variant is to dene a thread safe

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rograms never run backwards, so transitions that move down or to the left are not legal. (a) vertical (b) horizontal Figure 11.12: Legal transitions in a progress graph. The execution history of a program is modeled as a trajectory, or sequence of transitions, through the state space. Figure 11.13 shows the trajectory that corresponds to the instruction ordering À½ Ľ ͽ À¾ ľ ˽ ̽ ; ˾ ̾ For thread , the instructions ´Ä Í Ë µ that manipulate the contents of the shared variable cnt constitute a critical section (with respect to shared variable cnt) that should not be interleaved with the critical section of the other thread. The intersection of the two critical sections defines a region of the state space known as an unsafe region. Figure 11.14 shows the unsafe region for the variable cnt. Notice that the unsafe region abuts, but does not include, the states along its perimeter. For example, states ´À½ À¾ µ and ´Ë½ ; µ abut the unsafe region, but are not a part of it. A trajectory that skirts the unsafe region is known as a safe traject...
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.

Ask a homework question - tutors are online