see http://zguide.zeromq.org/page:all#Multithreading-with-ZeroMQ