[zeromq-dev] Newbie question

Martin Sustrik sustrik at 250bpm.com
Thu Nov 25 13:14:38 CET 2010


Hi Juan,


> In the ØMQ documentation it says "Each ØMQ socket belonging to a
> particular /context/ may only be used by *the thread that created it"*.
> This a very strong limitation for us. Because our clients (the
> application who will user the library) may have no control of threads,
> perhaps they run in a thread pool provided by another framework.
>
> I wanted to ask why this restriction exists.
> In the future, can we have a socketopt or a new socket type to overcome it?

This is already a solved problem in 0MQ/2.1 (the master on github). It's 
a feature called "migration of sockets between threads". In short, 0MQ 
socket can be still used only from a single thread at any specific point 
in time, however, sockets can be migrated to another thread when needed.

Martin



More information about the zeromq-dev mailing list