[Haskell-cafe] ZeroMQ Thread Safety
dct25-561bs at mythic-beasts.com
Wed May 27 18:30:42 UTC 2015
According to the ZeroMQ docs:
"Individual ØMQ sockets are not thread safe except in the case where
full memory barriers are issued when migrating a socket from one
thread to another."
The Haskell ZeroMQ binding  is a fairly thin wrapper around the C
API, and in particular doesn't seem to do much to enforce thread
safety as described above.
My question: do I need to use bound threads to call functions on
sockets to ensure that all the foreign calls happen on the same OS
thread, or is it the case that two consecutive foreign calls in a
single Haskell thread have a "full memory barrier" between them if
they end up being called from different OS threads?
Thanks in advance,
More information about the Haskell-Cafe