On 09/10/12 09:47, John Khvatov wrote:
> Hello Bennie,
>
> On Oct 9, 2012, at 11:13 AM, Bennie Kloosteman wrote:
>
>> Why not create the context and socket after you fork ?
> I don't want to use ZMQ in child process. I want to release all resources 
> used by ZMQ before master exiting.
>
> It needed for restart multi-worker application: old master exits, old workers 
> still serve existing clients, new master runs and start new workers for new 
> clients. It fails because new master can't bind to address which is still 
> used after I call zmq_close()/zmq_term().
>
> The question is how to release ZMQ resources (unbind TCP port) after fork()?
>

John

I think the child process needs to close all the file descriptors that 
it does not need, though there would still be a race, if you were to 
start a new master quickly enough.

If you exec a new process rather than just fork, the problem may also be 
alleviated.


Jon


_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to