'import ccall unsafe' and parallelism

Brandon Allbery allbery.b at gmail.com
Thu Aug 14 16:12:00 UTC 2014

On Thu, Aug 14, 2014 at 11:54 AM, Christian Höner zu Siederdissen <
choener at tbi.univie.ac.at> wrote:

> go xs = unsafePerformIO $ do
>   forM_ xs $ cfun
>   return $ somethingUnhealthy

I wonder if this is your real problem. `unsafePerformIO` does some extra
locking; the FFI specifies a function `unsafeLocalState`, which in GHC is
`unsafeDupablePerformIO` which skips the extra locking.

brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20140814/b625150e/attachment.html>

More information about the Glasgow-haskell-users mailing list