[zeromq-dev] zmq_poll

Serge Aleynikov serge at aleynikov.org
Fri May 21 17:04:24 CEST 2010


This is along the line of my thinking.  Is there any drawback or 
synchronization issues in having multiple app_threads and no checking 
that app_thread's tid matches thread_t::id()?

On 5/21/2010 11:00 AM, Martin Sustrik wrote:
> Hi Serge,
>
>> It would be nice to have 0MQ sockets owned by Erlang light-weight
>> processes (LWPs).  What's perceived in 0MQ world as application threads
>> would by the OS kernel threads running Erlang VM schedulers.  The
>> problem is that there's no control on which kernel thread LWPs would be
>> scheduled and therefore we cannot assume that a socket gets created on
>> some application thread and further send/receive calls would be done on
>> the same application thread.  I am not quite clear why there is such a
>> hard restriction in 0MQ to enforce a hard relationship between 0MQ
>> sockets and an application thread.  I suppose it's done to avoid locking
>> at some level, but could this restriction somehow be optionally lifted?
>
> In theory, it can be done modifying 0MQ so that it creates app_thread
> for each socket.
>
> That way socket could be migrated between threads -- assuming that full
> memory barrier is executed during the migration.
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list