[Haskell-cafe] ZeroMQ Thread Safety

21 views
Skip to first unread message

David Turner

unread,
May 27, 2015, 2:30:55 PM5/27/15
to haskell-cafe
Hi all,

According to the ZeroMQ docs[1]:

"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 [2] 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,

David

[1] http://api.zeromq.org/4-0:zmq
[2] http://hackage.haskell.org/package/zeromq4-haskell
_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

Reply all
Reply to author
Forward
0 new messages