Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use raw fork instead of forkIO #64

Open
harendra-kumar opened this issue May 28, 2017 · 1 comment
Open

Use raw fork instead of forkIO #64

harendra-kumar opened this issue May 28, 2017 · 1 comment

Comments

@harendra-kumar
Copy link
Contributor

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 #)
@agocorona
Copy link
Collaborator

If this is faster, It would be worth the pain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants