transient icon indicating copy to clipboard operation
transient copied to clipboard

Use raw fork instead of forkIO

Open harendra-kumar opened this issue 8 years ago • 1 comments

Since we create threads quite often it may be helpful to use raw fork instead of forkIO. Something like this:

-- A version of forkIO that does not include the outer exception
-- handler: saves a bit of time when we will be installing our own
-- exception handler.
{-# INLINE rawForkIO #-}
rawForkIO :: IO () -> IO ThreadId
rawForkIO action = IO $ \ s ->
   case (fork# action s) of (# s1, tid #) -> (# s1, ThreadId tid #)

harendra-kumar avatar May 28 '17 07:05 harendra-kumar

If this is faster, It would be worth the pain

agocorona avatar May 31 '17 22:05 agocorona