Multithreaded algorithms




CS255

Chris Pollett

Feb 9, 2015

Outline

Introduction

Going from Serial Algorithm to Parallel Algorithm

Method of Generating Functions

Dynamic Multithreaded Fibonacci

Quiz

Which of the following is true?

  1. We showed in class that the expected length of the longest streak of heads in `n` fair coin tosses is `Theta(n^(1/2))`.
  2. A random variable `X` with distribution given by `Pr{X=k} = (1- 1/b)^(k-1) cdot 1/b` follows the Bernoulli distribution.
  3. Suppose we were trying to give urls on the web (which might be quite long) unique 8 byte IDs by applying a good hash function. The odds of having seen a collision after processing more than 5 billion-ish distinct urls would be greater than 50%.

Model of Multithreaded Execution

A multithreaded DAG representing the computation of P-Fib(n)

More on Multithreaded Execution

The image of the last slide shows the computation of P-Fib(4).

Performance Measures

Runtime of a Multithreaded Computation

Parallelism