25 Oct
2001
25 Oct
'01
10:12 a.m.
It isn't safe to call foreign exported functions from more that one OS thread simultaneously.
OK, can I call a foreign exported function from some other thread while the main thread is in 'foreign import' native code? I could have calls to the foreign exported function block until the main thread called a special foreign imported 'yield' function.
This might work, but no guarantees. Make sure that at least the foreign import yield doesn't have an unsafe annotation. The reason I'm slightly worried is that the RTS isn't written to be used in a threaded environment - it doesn't use thread-friendly library calls, and I don't even want to think about signal handling. Cheers, Simon
8817
Age (days ago)
8817
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow