4.14. Using Concurrent Haskell

GHC supports Concurrent Haskell by default, without requiring a
special option or libraries compiled in a certain way. To get access to
the support libraries for Concurrent Haskell, just import
Control.Concurrent. More information on Concurrent Haskell is provided in the documentation for that module.

If a thread makes a foreign call (and the call is
not marked unsafe), then other
Haskell threads in the program will continue to run
while the foreign call is in progress.
Additionally, foreign exported
Haskell functions may be called from multiple OS
threads simultaneously. See
Section 8.2.4, “Multi-threading and the FFI”.

The following RTS option(s) affect the behaviour of Concurrent
Haskell programs:

-Cs

Sets the context switch interval to s
seconds. A context switch will occur at the next heap block
allocation after the timer expires (a heap block allocation occurs
every 4k of allocation). With -C0 or
-C, context switches will occur as often as
possible (at every heap block allocation). By default, context
switches occur every 20ms.