Export the affinity API from Control.Concurrent: forkOn and friends.
authorSimon Marlow <marlowsd@gmail.com>
Wed, 30 Mar 2011 10:05:04 +0000 (10:05 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 30 Mar 2011 10:05:04 +0000 (10:05 +0000)
commit88f389fc1807aac92b4b026c2b09b2ec6266d05b
tree475a9d0fd1ba8de5cd4f9a59326e3531c1c9745d
parent333e764afeb1c08b239caf9510e5e18a6c81ae31
Export the affinity API from Control.Concurrent: forkOn and friends.

forkOn             :: Int -> IO () -> IO ThreadId
forkOnWithUnmask   :: Int -> ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
getNumCapabilities :: IO Int
threadCapability   :: ThreadId -> IO (Int, Bool)

Following discussion on the libraries list, I renamed forkOnIO to
forkOn.  In due course we might want to also rename forkIO to fork.

I left the Int argument as it is, it's quite useful to be able to
specify a number to be interpreted modulo the actual number of
processors.

I also used the term "capability" consistently.  It might not be the
best choice, but we have to pick something.
Control/Concurrent.hs
GHC/Conc.lhs
GHC/Conc/Sync.lhs