15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

and software requirements and trade-offs. The objective of this chapter is to present a common framework<br />

for studying different multiprocessing and multithreading techniques, and to discuss existing multithreaded<br />

processors and futuristic proposals in the light of this framework. The following are some of<br />

the questions that are specifically addressed in the common framework:<br />

• Parallel programming model<br />

• Nature of threads<br />

• PE Interconnects<br />

• Role of the compiler<br />

The introduction section has highlighted the importance of multithreading and multiprocessing. The<br />

rest of this chapter is organized as follows. The section on “Parallel Processing Software Framework”<br />

presents a common framework for studying different multithreading and multiprocessing approaches,<br />

and highlights software issues that are important to consider while examining them. The section on<br />

“Parallel Processing Hardware Framework” presents a common framework for studying parallel processor<br />

hardware configurations. The “Concluding Remarks” section provides a survey of existing multithreaded<br />

processors and proposals. In particular, it describes how multithreading is employed in the multiscalar<br />

processor, the superthreaded processor, the trace processor, the M-machine, and some of the other<br />

multithreaded microarchitectures. Finally, “Concluding Remarks” presents a qualitative comparison and<br />

discusses future trends.<br />

Parallel Processing Software Framework<br />

In this section we discuss our framework for studying multithreading and multiprocessing. We also<br />

identify three key issues related to multithreading: thread granularity, parallel programming model, and<br />

program partitioning into threads. We shall discuss each of these issues in detail. Not all of these issues<br />

are entirely orthogonal to each other, and it is our objective to highlight how each issue bears on other<br />

related issues.<br />

We define a thread as a flow of control through a program and that flow’s current state (represented<br />

by a current program counter, a call/return stack and, occasionally, some thread-private data). The central<br />

idea behind multithreading and multiprocessing is to have multiple flows of control within a process,<br />

allowing parts of the process to be executed in parallel. A process can have one or more threads doing<br />

its work. Threads that execute in parallel are invariably control-independent, in which case the decision<br />

to execute a thread does not depend on the other active threads. Thus, instructions that are controldependent<br />

on a conditional branch invariably belong to the thread to which that branch belongs.<br />

Parallel Programming Model<br />

An important attribute of any multiprocessing/multithreading system is its parallel programming model,<br />

embodied in a parallel language or programming environment. This model specifies the names (such as<br />

registers and memory addresses) the thread can access, the operations it can perform on the named data,<br />

and the ordering semantics among these operations, particularly those done by distinct threads. (In the<br />

simplest case, the model assumes multiprogramming, which has no inter-thread communication and<br />

synchronization.) First, we will discuss thread sequencing model, which specifies ordering constraints<br />

(if any) on multiple threads. Then, we discuss inter-thread communication, which deals with passing<br />

data values among two or more threads. Finally, we discuss synchronization aspects of the programming<br />

model, which cause running threads to wait for one another, and waiting threads to resume execution<br />

at the proper time. Orchestrating the inter-thread ordering often requires explicit synchronization operations<br />

when the ordering implicit in the basic operations is not sufficient.<br />

Thread Granularity and Management<br />

Thread-level parallelism (TLP) is more coarse-grained than ILP, and has wide variance in granularity.<br />

We categorize the TLP granularities into three levels as described below. Depending on the granularity,<br />

© 2002 by CRC Press LLC

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

Saved successfully!

Ooh no, something went wrong!