[commit: ghc] master: GHC.Conc: clarify that 'forkOn' binds to capability, not a 'CPU' or 'Task' (e148d7d)
git at git.haskell.org
git at git.haskell.org
Thu Jul 10 16:21:43 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e148d7d1c0d5db39cd494c4a9b6860cd0f0bf852/ghc
>---------------------------------------------------------------
commit e148d7d1c0d5db39cd494c4a9b6860cd0f0bf852
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date: Thu Jul 10 02:56:23 2014 -0500
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: Sergei Trofimovich <slyfox at gentoo.org>
Test Plan: proofread for typos
Reviewers: simonmar, austin
Reviewed By: austin
Subscribers: simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D52
>---------------------------------------------------------------
e148d7d1c0d5db39cd494c4a9b6860cd0f0bf852
libraries/base/GHC/Conc/Sync.lhs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libraries/base/GHC/Conc/Sync.lhs b/libraries/base/GHC/Conc/Sync.lhs
index ebb7226..713e0b5 100644
--- a/libraries/base/GHC/Conc/Sync.lhs
+++ b/libraries/base/GHC/Conc/Sync.lhs
@@ -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.
More information about the ghc-commits
mailing list