Skip to content
  • Simon Marlow's avatar
    Export the affinity API from Control.Concurrent: forkOn and friends. · aec9d3e8
    Simon Marlow authored
    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.
    aec9d3e8