[Twisted-Python] epoll keep sharing state between process even after fork.

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Oct 23 11:31:55 MDT 2013


On 03:46 pm, grindizer at gmail.com wrote:
>Hi everybody
>
>I a came across a surprising problem when using the epoll based 
>reactor.
>(ticket here https://twistedmatrix.com/trac/ticket/6796)
>
>As you can see on the ticket, the epoll object seems to share some 
>state
>even after fork.
>
>[snip]
>
>- Using spawnProcess as mentioned in the ticket comment, is not an 
>option
>too, in my case, I need to share some state between the main process 
>and
>subprocess. (I have on object in main process space that I want to 
>inherit
>in all subprocess)

This doesn't really explain why you can't use `spawnProcess`.  There are 
other ways to share state between processes.  Perhaps if you describe 
the object you have someone can suggest a way to share it that will 
still satisfy your requirements without requiring that you use the 
`multiprocessing` module.

Jean-Paul




More information about the Twisted-Python mailing list