Commit e148d7d1 authored by Sergei Trofimovich's avatar Sergei Trofimovich Committed by Austin Seipp
Browse files

GHC.Conc: clarify that 'forkOn' binds to capability, not a 'CPU' or 'Task'



Summary:
Capability (HEC) can migrate to other Task (thus switch CPU)
unless capability was created as a bound haskell thread.

Task also can migrate to other CPU due to OS scheduler
(unless '-qa' RTS option is set).
Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>

Test Plan: proofread for typos

Reviewers: simonmar, austin

Reviewed By: austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D52
parent c80c574f
......@@ -219,10 +219,10 @@ forkIOWithUnmask :: ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
forkIOWithUnmask io = forkIO (io unsafeUnmask)
{- |
Like 'forkIO', but lets you specify on which processor the thread
Like 'forkIO', but lets you specify on which capability the thread
should run. Unlike a `forkIO` thread, a thread created by `forkOn`
will stay on the same processor for its entire lifetime (`forkIO`
threads can migrate between processors according to the scheduling
will stay on the same capability for its entire lifetime (`forkIO`
threads can migrate between capabilities according to the scheduling
policy). `forkOn` is useful for overriding the scheduling policy when
you know in advance how best to distribute the threads.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment