Introduction to AlgorithmsDecember 5, 2005
Massachusetts Institute of Technology6.046J/18.410J
Professors Erik D. Demaine and Charles E. LeisersonHandout 29
  
A Minicourse on Dynamic Multithreaded Algorithms
Charles E. Leiserson*
MIT Computer Science and Artificial Intelligence Laboratory
Cambridge, Massachusetts 02139, USA
December 5, 2005
Abstract
This tutorial teaches dynamic multithreaded algorithms using a Cilk-like [11, 8, 10] model. The material was taught in the MIT undergraduate class 6.046 Introduction to Algorithmsas two 80-minute lectures. The style of the lecture notes follows that of the textbook by Cormen, Leiserson, Rivest, and Stein [7], but the pseudocode from that textbook has been “Cilkified” to allow it to describe multithreaded algorithms. The first lecture teaches the basics behind multithreading, including defining the measures of work and critical-path length. It culminates in the greedy scheduling theorem due to Graham and Brent [9, 6]. The second lecture shows how parallel applications, including matrix multiplication and sorting, can be analyzed using divide-and-conquer recurrences.
1 Dynamic multithreaded programming
As multiprocessor systems have become increasingly available, interest has grown in parallel pro­ gramming. Multithreaded programming is a programming paradigm in which a single program is broken into multiple threads of control which interact to solve a single problem. These notes provide an introduction to the analysis of “dynamic” multithreaded algorithms, where threads can be created and destroyed as easily as an ordinary subroutine can be called and return.
1.1 Model
Our model of dynamic multithreaded computation is based on the procedure abstraction found in virtually any programming language. As an example, the procedure FIB gives a multithreaded algorithm for computing the Fibonacci numbers:1
*Support was provided in part by the Defense Advanced Research Projects Agency (DARPA) under Grant F30602- 97-1-0270, by the National Science Foundation under Grants EIA-9975036 and ACI-0324974, and by the Singapore- MIT Alliance.
1This algorithm is a terrible way to compute Fibonacci numbers, since it runs in exponential time when logarithmic methods are known [7, pp. 902–903], but it serves as a good didactic example.
2
Handout 29: Dynamic Multithreaded Algorithms3
FIB(n)
1if n < 2
2then return n
3x ← spawn FIB(n - 1)
4y ← spawn FIB(n - 2)
5sync
6return (y)
A spawn is the parallel analog of an ordinary subroutine call. The keyword spawn before the subroutine call in line 3 indicates that the subprocedure FIB(n - 1) can execute in parallel with the procedure FIB(nitself. Unlike an ordinary function call, however, where the parent is not resumed until after its child returns, in the case of a spawn, the parent can continue to execute in parallel with the child. In this case, the parent goes on to spawn FIB(n - 2). In general, the parent can continue to spawn off children, producing a high degree of parallelism.
A procedure cannot safely use the return values of the children it has spawned until it executes async statement. If any of its children have not completed when it executes a sync, the procedure suspends and does not resume until all of its children have completed. When all of its children return, execution of the procedure resumes at the point immediately following the sync statement. In the Fibonacci example, the sync statement in line 5 is required before the return statement in line 6 to avoid the anomaly that would occur if and were summed before each had been computed.
The spawn and sync keywords specify logical parallelism, not “actual” parallelism. That is, these keywords indicate which code may possibly execute in parallel, but what actually runs in parallel is determined by a scheduler, which maps the dynamically unfolding computation onto the available processors.
We can view a multithreaded computation in graph-theoretic terms as a dynamically unfolding dag= (V, E), as is shown in Figure 1 for FIB. We define a thread to be a maximal sequence of instructions not containing the parallel control statements spawn sync, and return . Threads make up the set of vertices of the multithreaded computation dag G. Each procedure execution is a linear chain of threads, each of which is connected to its successor in the chain by a continuation edge. When a thread spawns a thread v, the dag contains a spawn edge (u, v∈ E, as well as a continuation edge from to u’s successor in the procedure. When a thread returns, the dag contains an edge (u, v), where is the thread that immediately follows the next sync in the parent procedure. Every computation starts with a single initial thread and (assuming that the computation terminates), ends with a single final thread . Since the procedures are organized in a tree hierarchy, we can view the computation as a dag of threads embedded in the tree of procedures.
1.2 Performance Measures
Two performance measures suffice to gauge the theoretical efficiency of multithreaded algorithms. We define the work of a multithreaded computation to be the total time to execute all the operations in the computation on one processor. We define the critical-path length of a computation to be the longest time to execute the threads along any path of dependencies in the dag. Consider, for
4   Handout 29: Dynamic Multithreaded Algorithms
    111111  
    1111  
    111111  
    11 fib(4)11  
  111111 111111
  1111 1111
  111111 111111
  1111 1111
   fib(3)   fib(2) 
11111111  1111 
111111  1111 
11111111  1111 
111111  1111 
 fib(2) fib(1)  fib(1)fib(0) 
1111       
1111       
1111       
1111       
fib(1)fib(0)       
Figure 1A dag representing the multithreaded computation of FIB(4). Threads are shown as circles, and each group of threads belonging to the same procedure are surrounded by a rounded rectangle. Downward edges are spawns dependencies, horizontal edges represent continuation dependencies within a procedure, and upward edges are return dependencies.
example, the computation in Figure 1. Suppose that every thread can be executed in unit time. Then, the work of the computation is 17, and the critical-path length is 8.
When a multithreaded computation is executed on a given number of processors, its running time depends on how efficiently the underlying scheduler can execute it. Denote by Tthe running time of a given computation on processors. Then, the work of the computation can be viewed as T1, and the critical-path length can be viewed as T8.
The work and critical-path length can be used to provide lower bounds on the running time on Pprocessors. We have
T= T1/P ,(1)
since in one step, a -processor computer can do at most work. We also have 
T= T,(2)
since a -processor computer can do no more work in one step than an infi nite-processor computer. The speedup of a computation on processors is the ratio T1/T, which indicates how many times faster the -processor execution is than a one-processor execution. If T1/T= T(), then we say that the -processor execution exhibits linear speedup. The maximum possible speedup is T1/T8, which is also called the parallelism of the computation, because it represents the average amount of work that can be done in parallel for each step along the critical path. We denote the
parallelism of a computation by .
1.3 Greedy Scheduling
The programmer of a multithreaded application has the ability to control the work and critical-path length of his application, but he has no direct control over the scheduling of his application on a
Handout 29: Dynamic Multithreaded Algorithms5
given number of processors. It is up to the runtime scheduler to map the dynamically unfolding computation onto the available processors so that the computation executes efficiently. Good on­ line schedulers are known [3, 4, 5] but their analysis is complicated. For simplicity, we’ll illustrate the principles behind these schedulers using an off-line “greedy” scheduler.
greedy scheduler schedules as much as it can at every time step. On a -processor computer, time steps can be classified into two types. If there are or more threads ready to execute, the step is acomplete step, and the scheduler executes any threads of those ready to execute. If there are fewer than threads ready to execute, the step is an incomplete step, and the scheduler executes all of them. This greedy strategy is provably good.
Theorem 1 (Graham [9], Brent [6]) A greedy scheduler executes any multithreaded computationwith work Tand critical-path length Tin time
 T= T1/P T8(3)
on a computer with processors. 
Proof.For each complete step, work is done by the processors. Thus, the number of com­
plete steps is at most T1/P , because after T1/P such steps, all the work in the computation has been performed. Now, consider an incomplete step, and consider the subdag Gof that remains to be executed. Without loss of generality, we can view each of the threads executing in unit time, since we can replace a longer thread with a chain of unit-time threads. Every thread with in-degree is ready to be executed, since all of its predecessors have already executed. By the greedy scheduling policy, all such threads are executed, since there are strictly fewer than such threads. Thus, the critical-path length of Gis reduced by 1. Since the critical-path length of the subdag remaining to be executed decreases by each for each incomplete step, the number of incomplete steps is at most T8. Each step is either complete or incomplete, and hence Inequality (3) follows. 
Corollary 2 A greedy scheduler achieves linear speedup when O().
Proof. Since T1/T8, we have O(T1/T8), or equivalently, that TO(T1/P ). Thus, we haveT= T1/P TO(T1/P )
1.4 Cilk and Socrates
Cilk [4, 11, 10] is a parallel, multithreaded language based on the serial programming language C. Instrumentation in the Cilk scheduler provides an accurate measure of work and critical path. Cilk’s randomized scheduler provably executes a multithreaded computation on a -processor computer inTT1/P O(T8expected time. Empirically, the scheduler achieves T≈ T1/P Ttime, yielding near-perfect linear speedup if ≪ .
Among the applications that have been programmed in Cilk are the Socrates and Cilkchess chess-playing programs. These programs have won numerous prizes in international competition and are considered to be among the strongest in the world. An interesting anomaly occurred
Handout 29: Dynamic Multithreaded Algorithms
during the development of Socrates which was resolved by understanding the measures of work and critical-path length.
The Socrates program was initially developed on a 32-processor computer at MIT, but it was intended to run on a 512-processor computer at the National Center for Supercomputing Appli­ cations (NCSA) at the University of Illinois. A clever optimization was proposed which, during testing at MIT, caused the program to run much faster than the original program. Nevertheless, the optimization was abandoned, because an analysis of work and critical-path length indicated that the program would actually be slower on the NCSA machine.
Let us examine this anomaly in more detail. For simplicity, the actual timing numbers have
been simplified. The original program ran in T32 =65seconds at MIT on 32 processors. The
“optimized” program ran in T32'= 40 seconds also on 32 processors. The original program had
work T=2048seconds and critical-path length T= 1 second. Using the formula T=
T1/P Tas a good approximation of runtime, we discover that indeed T32 = 65 = 2048/32 + 1. The “optimized” program had work T= 1024 seconds and critical-path length T= 8 seconds,
yielding T32=40 = 1024/32 +8. But, now let us determine the runtimes on512 processors.
We have T512 =2048/512 + 1= 5and T512'= 1024/512 + 8 = 10, which is twice as slow!
Thus, by using work and critical-path length, we can predict the performance of a multithreaded computation.
Exercise 1-1. Sketch the multithreaded computation that results from executing FIB(5). Assume that all threads in the computation execute in unit time. What is the work of the computation? What is the critical-path length? Show how to schedule the dag on processors in a greedy fashion by labeling each thread with the time step on which it executes.
Exercise 1-2.Consider the following multithreaded procedure SUM for pairwise adding the ele­
ments of arrays A[1 . .nand B[1 . .nand storing the sums in C[1 . .n]:
SUM(A, B, C)
1for i ← to length[A]
2do C[i← spawn ADD(A[i], B[i])
3sync
ADD(x, y)
return (y)
Determine an asymptotic bound on the work, the critical-path length, and the parallelism of the computation in terms of n. Give a divide-and-conquer algorithm for the problem that is as parallel as possible. Analyze your algorithm.
Exercise 1-3. Prove that a greedy scheduler achieves the stronger bound 
T(T- T8)/P T.(4)
Exercise 1-4. Prove that the time for a greedy scheduler to execute any multithreaded computa­ tion is within a factor of of the time required by an optimal scheduler.
Handout 29: Dynamic Multithreaded Algorithms7
Exercise 1-5.For what number of processors do the two chess programs described in this
section run equally fast? 
Exercise 1-6.Professor Tweed takes some measurements of his (deterministic) multithreaded
program, which is scheduled using a greedy scheduler, and finds that T=80seconds and
T64 =10seconds. What is the fastest that the professor’s computation could possibly run on
10 processors? Use Inequality (4) and the two lower bounds from Inequalities (1) and (2) to derive your answer.
2 Analysis of multithreaded algorithms
We now turn to the design and analysis of multithreaded algorithms. Because of the divide-and- conquer nature of the multithreaded model, recurrences are a natural way to express the work and critical-path length of a multithreaded algorithm. We shall investigate algorithms for matrix multiplication and sorting and analyze their performance.
2.1 Parallel Matrix Multiplication
To multiply two n × n matrices and in parallel to produce a matrix C, we can recursively formulate the problem as follows:
CC2111CC2212 = AA2111 AA2212 · BB2111 BB2212 
   = AA2111BB1111 +AA2212BB2121 AA2111BB1212 +AA2212BB2222.
Thus, each n × n matrix multiplication can be expressed as multiplications and additions of (n/2) ×(n/2) submatrices. The multithreaded procedure MULT multiplies two n × n matrices, where is a power of 2, using an auxiliary procedure ADD to add n × n matrices. This algorithm is not in-place.
ADD(C, T, n)
1if = 1
2then C[11] ← C[11] + [11]
3return
4partition and into (n/2) × (n/2) submatrices
5spawn ADD(C11, T11, n/2)
6spawn ADD(C12, T12, n/2)
7spawn ADD(C21, T21, n/2)
8spawn ADD(C22, T22, n/2)
9sync
10return
8Handout 29: Dynamic Multithreaded Algorithms
MULT(C, A, B, n)
1if = 1
2then C[11] ← A[11] · B[11]
3return
4allocate a temporary matrix [1 . . n, . . n]
5partition ABC, and into (n/2) × (n/2) submatrices
6spawn MULT(C11, A11, B11, n/2)
7spawn MULT(C12, A11, B12, n/2)
8spawn MULT(C21, A21, B11, n/2)
9spawn MULT(C22, A21, B12, n/2)
10spawn MULT(T11, A12, B21, n/2)
11spawn MULT(T12, A12, B22, n/2)
12spawn MULT(T21, A22, B21, n/2)
13spawn MULT(T22, A22, B22, n/2)
14sync
15ADD(C, T, n)
The matrix partitionings in line 5 of MULT and line 4 of ADD take O(1) time, since only a constant number of indexing operations are required.
To analyze this algorithm, let A(nbe the -processor running time of ADD on n×n matrices, and let M(nbe the -processor running time of MULT on n × n matrices. The work (running time on one processor) for ADD can be expressed by the recurrence
A1(n) = 4A1(n/2) +T(1) 
= T(n2,  
which is the same as for the ordinary double-nested-loop serial algorithm.Since the spawned
procedures can be executed in parallel, the critical-path length for ADD is 
A8(n) = A8(n/2) +T(1) 
= T(lgn.  
The work for MULT can be expressed by the recurrence  
M1(n) = 8M1(n/2) + A1(n) 
=8M1(n/2) + T(n2)
=T(n3,
which is the same as for the ordinary triple-nested-loop serial algorithm. The critical-path length for MULT is
M8(n) = M8(n/2) + T(lgn)
2
= T(lg n.
Handout 29: Dynamic Multithreaded Algorithms9
Thus, the parallelism for MULT is M1(n)/M8(n)= T(n3lgn), which is quite high. To multiply
1000 ×1000 matrices, for example, the parallelism is (ignoring constants) about 10003/10= 107. Most parallel computers have far fewer processors.
To achieve high performance, it is often advantageous for an algorithm to use less space, because more space usually means more time. For the matrix-multiplication problem, we can eliminate the temporary matrix in exchange for reducing the parallelism. Our new algorithm MULT-ADD performsC ← C A · B using a similar divide-and-conquer strategy to MULT.
MULT-ADD(C, A, B, n)
1if = 1
2then C[11] ← C[11] + A[11] · B[11]
3return
4partition AB, and into (n/2) × (n/2) submatrices
5spawn MULT-ADD(C11, A11, B11, n/2)
6spawn MULT-ADD(C12, A11, B12, n/2)
7spawn MULT-ADD(C21, A21, B11, n/2)
8spawn MULT-ADD(C22, A21, B12, n/2)
9sync
10spawn MULT-ADD(C11, A12, B21, n/2)
11spawn MULT-ADD(C12, A12, B22, n/2)
12spawn MULT-ADD(C21, A22, B21, n/2)
13spawn MULT-ADD(C22, A22, B22, n/2)
14sync
15return
Let MA(nbe the -processor running time of MULT-ADD on n × n matrices. The work for MULT-ADD is MA1(n) = T(n3), following the same analysis as for MULT, but the critical-path length is now
MA8(n) =2MA8(n/2) + T(1)
=T(n,
since only 4 recursive calls can be executed in parallel.
Thus, the parallelism is MA1(n)/MA8(n) = T(n2). On 1000×1000 matrices, for example, the parallelism is (ignoring constants) still quite high: about 1000= 106. In practice, this algorithm often runs somewhat faster than the first, since saving space often saves time due to hierarchical memory.
10Handout 29: Dynamic Multithreaded Algorithms
1l/2l
A= A[l/2]= A[l/2]
  
1j+ 1m
     
B = A[l/2] = A[l/2]
    
Figure 2Illustration of P-MERGE. The median of array is used to partition array B, and then the lower portions of the two arrays are recursively merged, as, in parallel, are the upper portions.
2.2 Parallel Merge Sort
This section shows how to parallelize merge sort. We shall see the parallelism of the algorithm depends on how well the merge subroutine can be parallelized.
The most straightforward way to parallelize merge sort is to run the recursion in parallel, as is done in the following pseudocode:
MERGE-SORT (A, p, )r
1if p < r
2then q ← (r)/2
3spawn MERGE-SORT (A, p, )q
4spawn MERGE-SORT (A, q+ 1, r)
5sync
6MERGE(A, p, q,r
7return
The work of MERGE-SORT on an array of elements is 
T1(n) =2T1(n/2) +T(n)
=T(nlg n, 
since the running time of MERGE is T(n). Since the two recursive spawns operate in parallel, the critical-path length of MERGE-SORT is
T8(n) = T8(n/2) + T(n) = T(n.
Consequently, the parallelism of the algorithm is T1(n)/T8(n) = T(lgn), which is puny. The obvious bottleneck is MERGE.
The following pseudocode, which is illustrated in Figure 2, performs the merge in parallel.
Handout 29: Dynamic Multithreaded Algorithms11
P-MERGE (A[1 . .l], B[1 . .m], C[1 . .n]) 
1if m > l without loss of generality, larger array should be first
2then P-MERGE (B[1 . . m], A[1 . . l], C[1 . . n])
3return
4if = 1
5then C[1] ← A[1]
6return
7if = 1and = 1
8then if A[1] B[1]
9 then C[1] ← A[1]C[2] ← B[1]
10 else C[1] ← B[1]C[2] ← A[1]
11return
12find such that B[jA[l/2] B[+ 1]using binary search
13spawn P-MERGE(A[1 . . (l/2)], B[1 . . j], C[1 . . (l/2 +j)])
14spawn P-MERGE(A[(l/2+ 1). . l], B[(+ 1). . m], C[(l/2 ++ 1). . n])
15sync 
16return 
This merging algorithm finds the median of the larger array and uses it to partition the smaller array. Then, the lower portions of the two arrays are recursively merged, and in parallel, so are the upper portions.
To analyze P-MERGE , let PM(nbe the -processor time to merge two arrays and havingelements in total. Without loss of generality, let be the larger of the two arrays, that is, assume m.
We’ll analyze the critical-path length first. The binary search of takes T(lg mtime, which in the worst case is T(lg n). Since the two recursive spawns in lines 13 and 14 operate in parallel, the worst-case critical-path length is T(lg nplus the worst-case critical path-length of the spawn operating on the larger subarrays. In the worst case, we must merge half of with all of B, in which case the recursive spawn operates on at most 3n/elements. Thus, we have
PM8(n)=PM8(3n/4) +T(lgn)
  2 
 =T(lg n. 
To analyze the work of MERGE, observe that although the two recursive spawns may operate on different numbers of elements, they always operate on elements between them. Let an be the number of elements operated on by the first spawn, where is a constant in the range 1/3/4. Thus, the second spawn operates on (1 a)elements, and the worst-case work satisfies the recurrence
PM1(n) = PM1(an) + PM1((1 a)n) + T(lgn.(5)
We shall show that PM1(n) = T(nusing the substitution method. (Actually, the Akra-Bazzi method [2], if you know it, is simpler.) We assume inductively that PM1(nan -lg for some
12 Handout 29: Dynamic Multithreaded Algorithms
constants a, b >0. We have
PM1(naan lg(an) + a(1 a)lg((1 a)n) + T(lgn)
=an b(lg(an) + lg((1a)n)) + T(lgn) 
=an b(lg + lg+ lg(1a) + lgn) +T(lgn)
=an lg (b(lg + lg(a(1 a))) T(lg n))
an lg n , 
since we can choose large enough so that b(lg + lg(a(1 a))) dominates T(lg n). Moreover, we can pick large enough to satisfy the base conditions. Thus, PM1(n) = T(n), which is the same work asymptotically as the ordinary, serial merging algorithm.
We can now reanalyze the MERGE-SORT using the P-MERGE subroutine. The work T1(nremains the same, but the worst-case critical-path length now satisfies
   2
 T8(n) = T8(n/2) +T(lg n)
  3 
 =T(lg n. 
The parallelism is now T(lg n)/T(lgn)= T(n/ lgn).
Exercise 2-1.Give an efficient and highly parallel multithreaded algorithm for multiplying an
×matrix by a length-vector that achieves work T(n2and critical path T(lg n). Analyze the work and critical-path length of your implementation, and give the parallelism.
Exercise 2-2. Describe a multithreaded algorithm for matrix multiplication that achieves work T(n3)and critical path T(lg n). Comment informally on the locality displayed by your algorithm in the ideal cache model as compared with the two algorithms from this section.
Exercise 2-3. Write a Cilk program to multiply an n×nmatrix by an n×nmatrix in parallel. Analyze the work, critical-path length, and parallelism of your implementation. Your algorithm should be efficient even if any of n1n2, and nare 1.
Exercise 2-4. Write a Cilk program to implement Strassen’s matrix multiplication algorithm in parallel as efficiently as you can. Analyze the work, critical-path length, and parallelism of your implementation.
Exercise 2-5. Write a Cilk program to invert a symmetric and positive-definite matrix in parallel. (Hint:Use a divide-and-conquer approach based on the ideas of Theorem 31.12 from [7].)
Exercise 2-6. Akl and Santoro [1] have proposed a merging algorithm in which the first step is to find the median of all the elements in the two sorted input arrays (as opposed to the median of the elements in the larger subarray, as is done in P-MERGE ). Show that if the total number of elements in the two arrays is n, this median can be found using T(lg ntime on one processor in the worst case. Describe a linear-work multithreaded merging algorithm based on this subroutine that has a parallelism of T(n/ lg2n). Give and solve the recurrences for work and critical-path length, and determine the parallelism. Implement your algorithm as a Cilk program.
Handout 29: Dynamic Multithreaded Algorithms13
Exercise 2-7. Generalize the algorithm from Exercise 2-6 to find arbitrary order statistics. De­ scribe a merge-sorting algorithm with T(lg nwork that achieves a parallelism of T(n/ lg n). (Hint: Merge many subarrays in parallel.)
Exercise 2-8. The length of a longest-common subsequence of two length-sequences and can be computed in parallel using a divide-and-conquer multithreaded algorithm. Denote by c[i, jthe length of a longest common subsequence of x[1 . . ]and y[1 . . j]. First, the multithreaded algorithm recursively computes c[i, jfor all in the range = i = n/and all in the range = j = n/2. Then, it recursively computes c[i, jfor = i = n/and n/< j= n, while in parallel recursively computing c[i, jfor n/< i= n and = j = n/2. Finally, it recursively computes c[i, jfor n/< i= n and n/< j= n. For the base case, the algorithm computes c[i, jin terms of c[i - 1, j - 1]c[i - 1, j], and c[i, j - 1]in the ordinary way, since the logic of the algorithm guarantees that these three values have already been computed.
That is, if the dynamic programming tableau is broken into four pieces
I II
,
III IV
then the recursive multithreaded code would look something like this:
I
spawn II
spawn III
sync
IV
return
Analyze the work, critical-path length, and parallelism of this algorithm. Describe and analyze an algorithm that is asymptotically as efficient (same work) but more parallel. Make whatever interesting observations you can. Write an efficient Cilk program for the problem.
References
[1]Selim G. Akl and Nicola Santoro. Optimal parallel merging and sorting without memory conflicts.IEEE Transactions on Computers, C-36(11), November 1987.
[2]M. Akra and L. Bazzi. On the solution of linear recurrence equations. Computational Opti­ mization and Application, 10:195–210, 1998.
[3]Robert D. Blumofe. Executing Multithreaded Programs Efficiently. PhD thesis, Depart­ ment of Electrical Engineering and Computer Science, Massachusetts Institute of Techno­ logy, September 1995.
14Handout 29: Dynamic Multithreaded Algorithms
[4]Robert D. Blumofe, Christopher F. Joerg, Bradley C. Kuszmaul, Charles E. Leiserson, Keith H. Randall, and Yuli Zhou. Cilk: An efficient multithreaded runtime system. In
Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Paral­ lel Programming (PPoPP), pages 207–216, Santa Barbara, California, July 1995.
[5]Robert D. Blumofe and Charles E. Leiserson. Scheduling multithreaded computations by work stealing. In Proceedings of the 35th Annual Symposium on Foundations of Computer Science (FOCS), pages 356–368, Santa Fe, New Mexico, November 1994.
[6]Richard P. Brent. The parallel evaluation of general arithmetic expressions. Journal of the ACM, 21(2):201–206, April 1974.
[7]Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms. The MIT Press and McGraw-Hill, second edition, 2001.
[8]Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. The implementation of the Cilk­ 5 multithreaded language. In ACM SIGPLAN ’98 Conference on Programming Language Design and Implementation (PLDI), pages 212–223, Montreal, Canada, June 1998.
[9]R. L. Graham. Bounds on multiprocessing timing anomalies. SIAM Journal on Applied Mathematics, 17(2):416–429, March 1969.
[10]Keith H. Randall. Cilk: Efficient Multithreaded Computing. PhD thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, May 1998.
[11]Supercomputing Technologies Group, MIT Computer Science and Artificial Intelligence Laboratory. Cilk 5.3.2 Reference Manual, November 2001.

0 comments: