21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MIPS MT: A Multithreaded RISC Architecture 13<br />

viewtype ef_try; /* Empty/Full non-block<strong>in</strong>g poll */<br />

viewtype pv_sync; /* PV Semaphore block<strong>in</strong>g load/store */<br />

viewtype pv_try; /* PV Semaphore non-block<strong>in</strong>g poll */<br />

viewtype reserved[10]; /* Reserved for future views */<br />

} itc_cell;<br />

For example, the ef_sync cell view provides classical block<strong>in</strong>g empty/full semantics,<br />

such that if itc_ptr is a po<strong>in</strong>ter to an itc_cell <strong>in</strong> an “empty” state, then<br />

x = itc_ptr->ef_sync;<br />

will cause the execut<strong>in</strong>g thread to be suspended until such time as some other <strong>in</strong>struction<br />

stream performs an operation like<br />

itc_ptr->ef_sync = y;<br />

at which po<strong>in</strong>t the first thread’s x variable will pick up the value of y, and it will resume<br />

execution.<br />

The pv_sync view provides a more complex primitive, that of a count<strong>in</strong>g, or PV semaphore[10].<br />

Stores which reference this view cause the value of the cell to be atomically<br />

<strong>in</strong>cremented, regardless of the register value stored, while loads return the value and<br />

perform a post-decrement if it is non-zero. If the pre-load value is zero, the load blocks<br />

until a pv_sync store is done.<br />

The “try” views allow for non-block<strong>in</strong>g synchronization, us<strong>in</strong>g either the empty/full<br />

or the P/V paradigm. In the pv_try case, loads return the cell data value, even if zero,<br />

perform<strong>in</strong>g an auto-decrement only if the pre-load value was non-zero. In the ef_try<br />

case, loads references return zero if the cell is empty, regardless of the last data value<br />

written, and stores may be attempted us<strong>in</strong>g the MIPS32 SC (store conditional) <strong>in</strong>struction,<br />

which will <strong>in</strong>dicate failure if the cell is full. Whereas the ef_sync view allows arbitrary<br />

data to be passed through the cell, the use of a zero value to <strong>in</strong>dicate the failure<br />

of a load from an ef_try view implies that a word value of zero cannot be passed. In the<br />

most frequent use case, however, it is po<strong>in</strong>ters that are passed between threads via the<br />

ITC cell, and a null po<strong>in</strong>ters and non-po<strong>in</strong>ters from an empty cell can be treated alike.<br />

5 Hybrid Schedul<strong>in</strong>g Control<br />

Most of the study and application of multithreaded processor architecture has focused<br />

on multithread<strong>in</strong>g as a latency tolerance technique, a means of keep<strong>in</strong>g fast functional<br />

units busy <strong>in</strong> the face of long operand delays. This is of value <strong>in</strong> computationally <strong>in</strong>tensive<br />

embedded applications, but <strong>in</strong> many cases, it is the ability to provide latency avoidance,<br />

rather than latency tolerance, where mulithread<strong>in</strong>g provides an advantage <strong>in</strong> such<br />

systems[11]. MIPS MT provides architectural support for this <strong>in</strong> several ways, allow<strong>in</strong>g<br />

processor hardware, system and application software, and external logic to jo<strong>in</strong>tly control<br />

the schedul<strong>in</strong>g of <strong>in</strong>struction streams.<br />

5.1 Zero-Latency Event Service Us<strong>in</strong>g YIELD Instructions<br />

The use of the YIELD <strong>in</strong>struction for thread term<strong>in</strong>ation was described <strong>in</strong> section 3.2<br />

above, but the YIELD <strong>in</strong>struction is <strong>in</strong> fact a general tool for controll<strong>in</strong>g the execution

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!