'import ccall unsafe' and parallelism

Johan Tibell johan.tibell at gmail.com
Thu Aug 14 16:00:16 UTC 2014


On Thu, Aug 14, 2014 at 5:54 PM, Christian Höner zu Siederdissen <
choener at tbi.univie.ac.at> wrote:
> However, due to the way ghc handles unsafe imports, namely block
> everything else whenever 'cfun' is called, I happen to have only one
> active 'go'. Lets assume 'cfun' is cheap and would suffer from 'ccall
> safe' more than I'd be willing to pay.

Calls to unsafe functions do not block everything! Other Haskell threads
can continue running on other capabilities (make sure you run your program
with +RTS -N). However, make sure that the C function itself never blocks,
or it might deadlock your program.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20140814/7cd7acbe/attachment.html>

More information about the Glasgow-haskell-users mailing list