miércoles, 4 de abril de 2012

Distributed and parallel systems Extra Points

1. In which case is it straightforward to modify a recursive algorithm into a parallel one?
When the data are highly dependent, ie the result of the next iteration depends on the previous iteration

2. When is it impossible to turn an algorithm into a parallel one?
When there are inter-task dependencies

3. How will a process know when a thread that it previously forked finishes execution?
By using communication and synchronization between threads

4. Why do multi-threaded programs sometimes run slower than single-threaded versions?
The fact that the algoritms can be parallelized doesn't mean that they are optimal, sometimes the algoritmo is optimal only when there is a lot of data because when there is a little amount of data, it could take longer distributing tasks than running the code.

5. How does one ensure that one thread printing will not mess up another thread’s printouts?
By using locks that protect critical parts of code

1 comentario:

  1. I would mention join in question 3. I'll put you 3+2 extras in the lab over the next two weeks.

    ResponderEliminar