On Thu, Sep 28, 2017 at 4:57 PM, Albert Y. C. Lai <tre...@vex.net> wrote:

> Suppose I have a C program with multiple C threads calling Haskell
> functions, maybe the same Haskell function too, and the GHC RTS used is the
> unthreaded one. What will go wrong?
>
> I ask because Cabal/cabal-install has recently added building of
> export-to-C shared libraries, i.e., the "foreign-library" section. It sees
> to all the technical details, very nice, I'm very happy about this
> addition, but it chooses the unthreaded GHC RTS.
>

I don't expect the unthreaded RTS to be reentrant, so would expect you to
need locking around calls into it to avoid the dreaded 'scheduler entered
unsafely!' RTS error. And thread-local storage might be an issue.

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

Reply via email to