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.

6.1 Thread Context Virtualization<br />

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

User-mode code has no knowledge of which physical TC it is us<strong>in</strong>g, nor which physical<br />

TC is allocated by a successful FORK <strong>in</strong>struction. All <strong>in</strong>teraction between concurrently<br />

execut<strong>in</strong>g threads is done via shared memory or memory-like storage, and there is no<br />

architectural assumption made about whether it is the “parent” or “child” which executes<br />

first after a FORK.<br />

When a FORK <strong>in</strong>struction is issued, it is transparent to the application whether a TC<br />

was allocated and launched, or whether a thread overflow exception was taken <strong>in</strong>stead.<br />

In response to the thread overflow exception, an operat<strong>in</strong>g system has the option of<br />

treat<strong>in</strong>g it as a fatal application error, treat<strong>in</strong>g it as an exception to be raised to the application,<br />

or emulat<strong>in</strong>g the operation.<br />

Emulation of a FORK implies hybrid schedul<strong>in</strong>g, where<strong>in</strong> the multithreaded processor<br />

schedules among the threads resident <strong>in</strong> N TCs, while system software multiplexes<br />

M>N software threads across those N TCs. The MIPS MT architecture facilitates this<br />

with MFTR (Move From Thread Register) and MTTR (Move To Thread Register) <strong>in</strong>structions,<br />

which allow a privileged thread runn<strong>in</strong>g on one TC to halt another TC and<br />

manipulate its contents, and with the per-TC schedul<strong>in</strong>g feedback registers that allow<br />

the forward progress of each thread to be monitored.<br />

TCs which are blocked on ITC references or YIELD <strong>in</strong>structions may be halted and<br />

swapped-out without any side-effect on the software-visible state of the thread or of the<br />

ITC storage.<br />

6.2 ITC Storage Virtualization<br />

ITC storage is a special case of physical memory, and can be mapped and protected by<br />

the MIPS32 MMU. Unlike physical memory, ITC storage cannot be swapped <strong>in</strong> or out<br />

with direct I/O operations. System software must extract and restore both the cell data<br />

and the cell control state, via the bypass and control views, respectively.<br />

6.3 YIELD Qualifier Virtualization<br />

The MIPS MT architecture exposes a new set of physical <strong>in</strong>puts, the YIELD qualifiers,<br />

to user-mode software. To allow for trap and emulation of qualified YIELD<br />

operations, each VPE has a privileged mask register to selectively enable the YIELD<br />

qualifiers. If an application’s YIELD <strong>in</strong>struction attempts to wait on an <strong>in</strong>put that has not<br />

been enabled <strong>in</strong> the associated mask, an exception is taken. The operat<strong>in</strong>g system can<br />

then implement an appropriate policy of term<strong>in</strong>ation, rais<strong>in</strong>g of a software exception, or<br />

emulation of the YIELD with a software suspension of the thread.<br />

7 Software Use Models<br />

The flexibility of the MIPS MT architecture as a multithread<strong>in</strong>g framework has been<br />

demonstrated <strong>in</strong> the development of four different operat<strong>in</strong>g system models. All of them<br />

proved usable, and each has its dist<strong>in</strong>ct advantages.

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

Saved successfully!

Ooh no, something went wrong!