本文介紹了如何在python中將文件描述符從父級傳遞給子級?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我正在使用多處理模塊,并使用池來啟動多個工作人員.但是在父進程中打開的文件描述符在工作進程中是關閉的.我希望他們開放..!有沒有辦法傳遞文件描述符以在父子之間共享?
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?
推薦答案
據我所知,沒有一種方法可以在進程之間共享文件描述符.如果存在方法,它很可能是特定于操作系統的.
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.
這篇關于如何在python中將文件描述符從父級傳遞給子級?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!