patch applied (packages/base): Export the affinity API from Control.Concurrent: forkOn and friends.

Simon Marlow marlowsd at gmail.com
Wed Mar 30 13:42:42 CEST 2011


Wed Mar 30 03:05:04 PDT 2011  Simon Marlow <marlowsd at gmail.com>
  * 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.

    M ./Control/Concurrent.hs +6
    M ./GHC/Conc.lhs -1 +2
    M ./GHC/Conc/Sync.lhs -22 +38

View patch online:
http://darcs.haskell.org/cgi-bin/darcsweb.cgi?r=packages/base;a=darcs_commitdiff;h=20110330100504-12142-95e4936396f95164de7fbf31156797f34002a846.gz



More information about the Cvs-libraries mailing list