[zeromq-dev] Is it ok to fork() a new process with an active context?

Tom Nakamura tnakamura at eml.cc
Sun Jan 5 15:45:02 CET 2014


Suppose I want to write some sort of server which forks a new worker
process for every incoming connection (on Linux/Unix).  Does it suffice
to fork() a child process, immediately close the inherited
context/sockets in the child and create new context/socket to talk to
the parent?  Or must I prefork before creating a context in the parent?

The reason I want to use processes instead of threads is because the
"workers" in my particular project are 3rd party programs that I must
run as a separate process (no API to integrate into a C program). 
Tom



More information about the zeromq-dev mailing list