Re: [zeromq-dev] (py)zmq, fork and cloexec

2012-06-21 Thread Christian Heimes
Am 20.06.2012 17:04, schrieb Ivan Pechorin: > 2012/6/20 Christian Heimes mailto:li...@cheimes.de>> > > You'd have to register all file descriptors in a > central registry, remove the FDs on close and close() the FDs after > fork(). That's lots of work but C++ should make it easie > >

Re: [zeromq-dev] (py)zmq, fork and cloexec

2012-06-20 Thread Ivan Pechorin
2012/6/20 Christian Heimes > You'd have to register all file descriptors in a > central registry, remove the FDs on close and close() the FDs after > fork(). That's lots of work but C++ should make it easie > > Sounds too complex: why not just close() all the FDs >= 3 after fork(), before exec*()

Re: [zeromq-dev] (py)zmq, fork and cloexec

2012-06-20 Thread Christian Heimes
Am 20.06.2012 14:43, schrieb Ian Barber: > This is interesting - I wonder if this is somethign that would help the > situations where people do use fork to manage their children (in PHP > that happens a fair bit). No, CLOEXEC doesn't help you with fork() only programs. Just fork() call doesn't eva

Re: [zeromq-dev] (py)zmq, fork and cloexec

2012-06-20 Thread Ian Barber
On Tue, Jun 19, 2012 at 3:06 PM, Christian Heimes wrote: > ZMQ already has an extensive usage of file descriptors. Some may even > they it creates FDs like crazy. Without CLOEXEC all child processes > inherit the FDs from their parent process, therefore increasing the > total amount of FDs in the

Re: [zeromq-dev] (py)zmq, fork and cloexec

2012-06-19 Thread Min RK
On Jun 19, 2012, at 7:06 AM, Christian Heimes wrote: > Hello all, > > I've done some tests with pyzmq to check if ZQM sets the CLOEXEC flag on > its file descriptors. During the tests I ran into several issues that > might be bugs in ZMQ or pyzmq. > > My setup > OS: Ubuntu 12.04 X86_64 > zmq

[zeromq-dev] (py)zmq, fork and cloexec

2012-06-19 Thread Christian Heimes
Hello all, I've done some tests with pyzmq to check if ZQM sets the CLOEXEC flag on its file descriptors. During the tests I ran into several issues that might be bugs in ZMQ or pyzmq. My setup OS: Ubuntu 12.04 X86_64 zmq: 2.2.1 Python: 2.7.3 64bit pyzmq: 2.1.11 Python, zmq and pyzqm are