
Hi, I'm building a DLL using the instructions here: http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html I must call startupHaskell before I make any calls to Haskell functions. However, that page doesn't detail any thread safety rules. In particular: * If I call startupHaskell on Thread 1, can I make Haskell calls from Thread 2. * Can I make Haskell calls from both Thread 1 and Thread 2 simultaneously. Many thanks Neil

Neil Mitchell wrote:
Hi,
I'm building a DLL using the instructions here: http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html
I must call startupHaskell before I make any calls to Haskell functions. However, that page doesn't detail any thread safety rules. In particular:
* If I call startupHaskell on Thread 1, can I make Haskell calls from Thread 2.
Yes - but of course you must wait for startupHaskell, aka hs_init, to finish first. Also you must compile with -threaded.
* Can I make Haskell calls from both Thread 1 and Thread 2 simultaneously.
Yes, with -threaded. Cheers, Simon
participants (2)
-
Neil Mitchell
-
Simon Marlow