Search code examples
pythonmultiprocessingfile-descriptor

How to pass file descriptors from parent to child in python?


I am using multiprocessing module, and using pools to start multiple workers. But the file descriptors which are opened at the parent process are closed in the worker processes. I want them to be open..! Is there any way to pass file descriptors to be shared across parent and children?


Solution

  • There isn't a way that I know of to share file descriptors between processes. If a way exists, it is most likely OS specific.

    My guess is that you need to share data on another level.