From: Simon Marlow Date: Mon, 27 Mar 2006 12:41:51 +0000 (+0000) Subject: Add a new primitive forkOn#, for forking a thread on a specific Capability X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c520a3a2752ffcec5710a88a8a2e219c20edfc8a;hp=c520a3a2752ffcec5710a88a8a2e219c20edfc8a;p=ghc-hetmet.git Add a new primitive forkOn#, for forking a thread on a specific Capability This gives some control over affinity, while we figure out the best way to automatically schedule threads to make best use of the available parallelism. In addition to the primitive, there is also: GHC.Conc.forkOnIO :: Int -> IO () -> IO ThreadId where 'forkOnIO i m' creates a thread on Capability (i `rem` N), where N is the number of available Capabilities set by +RTS -N. Threads forked by forkOnIO do not automatically migrate when there are free Capabilities, like normal threads do. Still, if you're using forkOnIO exclusively, it's a good idea to do +RTS -qm to disable work pushing anyway (work pushing takes too much time when the run queues are large, this is something we need to fix). ---