... | ... | @@ -30,7 +30,7 @@ SMP parallelism we assume that the OS will schedule multiple OS |
|
|
threads across the available CPUs.
|
|
|
|
|
|
|
|
|
OS threads are only used by the runtime for two reasons:
|
|
|
OS threads are used by the threaded runtime for two reasons:
|
|
|
|
|
|
- To support non-blocking foreign calls: a foreign call
|
|
|
should not block the other Haskell threads in the system from
|
... | ... | @@ -38,6 +38,7 @@ OS threads are only used by the runtime for two reasons: |
|
|
|
|
|
- To support SMP parallelism.
|
|
|
|
|
|
Additionally, both threaded/single-threaded flavours of the runtime spawns a background OS thread to run the RTS timer, which periodically sets the context switch flag. This is not supported on platforms that lack threading functionality though, e.g. wasm32.
|
|
|
|
|
|
Haskell threads are much lighter-weight (at least 100x) than OS threads.
|
|
|
|
... | ... | |