[document -feager-blackholing Simon Marlow **20090115093922 Ignore-this: 5958a16c7148cb5df0f4b3f1e1dee6d6 ] { hunk ./docs/users_guide/flags.xml 1432 + + + + Turn on eager blackholing + dynamic + - + hunk ./docs/users_guide/using.xml 1768 - - Options for SMP parallelism + + Compile-time options for SMP parallelism hunk ./docs/users_guide/using.xml 1773 - linkend="options-linker" />). Then, to run a program on multiple - CPUs, use the RTS option: + linkend="options-linker" />). Additionally, the following + compiler options affect parallelism: hunk ./docs/users_guide/using.xml 1776 + + + + + + + Blackholing is the act of marking a thunk (lazy + computuation) as being under evaluation. It is useful for + three reasons: firstly it lets us detect certain kinds of + infinite loop (the NonTermination + exception), secondly it avoids certain kinds of space + leak, and thirdly it avoids repeating a computation in a + parallel program, because we can tell when a computation + is already in progress. + + + The option causes + each thunk to be blackholed as soon as evaluation begins. + The default is "lazy blackholing", whereby thunks are only + marked as being under evaluation when a thread is paused + for some reason. Lazy blackholing is typically more + efficient (by 1-2% or so), because most thunks don't + need to be blackholed. However, eager blackholing can + avoid more repeated computation in a parallel program, and + this often turns out to be important for parallelism. + + + + We recommend compiling any code that is intended to be run + in parallel with the + flag. + + + + + + + + RTS options for SMP parallelism + + To run a program on multiple CPUs, use the + RTS option: + }