Multithreading Algorithms
Multithreading Algorithms
MULTITHREADING ALGORITHMS
SERIAL ALGORITHMS & PARALLEL ALGORITHMS
It supports:
Nested parallelism: It allows a subroutine to be
spawned, allowing the caller to proceed while the
spawned subroutine is computing its result.
Parallel loops: regular for loops except that the
iterations can be executed concurrently.
ADVANTAGES OF DYNAMIC MULTITHREADING
Fibonacci Example
The serial algorithm: Fib(n)
Repeated work
Complexity
Work:
Total time to execute the entire computation on
one processor.
Sum of the times taken by each of the strands.
Span:
Longest time to execute thge strands along in path
in the dag.
The span equals the number of vertices on a
longest or critical path.
Example!
PERFORMANCE MEASURES
Work: T1
Speedup:
Speedup of a computation on P processors is the
ratio T1 /TP
How many times faster the computation is on P
processors than on one processor.
It’s at most P.