In the book Parallel and Concurrent  Programming in Haskell  http://chimera.labs.oreilly.com/books/1230000000929/ch02.html#sec_par-eval-sudoku2 a list of sudokus is solved in parallel.

In version 2 (sudoku2.hs) the program splits the list of sudokus in 2 seperate lists and solves these lists in parallel.

In version3 (sudoku3.hs) parMap is used.

What I don’t understand is why in sudoku2 the program has to wait until the parallel computations are finished with rseqs while in sudoku3.hs there is no rseq (not in the main program nor in parMap)? Why can’t program sudoku3.hs terminate before all parallel calculations are finished as in Example 2-1. rpar/rpar?

 

Kees