<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 03:46 pm, <a href="mailto:grindizer@gmail.com" target="_blank">grindizer@gmail.com</a> wrote:<br>
>Hi everybody<br>
><br>
>I a came across a surprising problem when using the epoll based<br>
>reactor.<br>
>(ticket here <a href="https://twistedmatrix.com/trac/ticket/6796" target="_blank">https://twistedmatrix.com/trac/ticket/6796</a>)<br>
><br>
>As you can see on the ticket, the epoll object seems to share some<br>
>state<br>
>even after fork.<br>
><br>
>[snip]<br>
><br>
>- Using spawnProcess as mentioned in the ticket comment, is not an<br>
>option<br>
>too, in my case, I need to share some state between the main process<br>
>and<br>
>subprocess. (I have on object in main process space that I want to<br>
>inherit<br>
>in all subprocess)<br>
<br>
This doesn't really explain why you can't use `spawnProcess`.  There are<br>
other ways to share state between processes.  Perhaps if you describe<br>
the object you have someone can suggest a way to share it that will<br>
still satisfy your requirements without requiring that you use the<br>
`multiprocessing` module.<br>
<br>
Jean-Paul<br></blockquote><div><br></div><div>Hi.</div><div><br></div><div>For the moment I share a factory object, but it's the underlying "protocol class" that is really needed.</div><div>The code takes a factory object, and then launch a set of worker/process. </div>
<div>when a connection is made on the parent process, the socket handler will be sent to one of the process (using sendmsg), the process will then run reactor.adoptStreamConnection and this is when we need the protocol class.</div>
<div>There is an example of what I would like to achieve here <a href="https://github.com/Grindizer/scaletix">https://github.com/Grindizer/scaletix</a> the example works with select or poll reactor.<br></div><div><br></div>
<div>with spawnProcess I guess the child process will need to somehow import the factory class and should be given the way to instanciate it ? isn't it ? I don't know other way to do it actually ?</div><div><br></div>
<div>thankx again.</div><div><br></div><div><br></div><div> </div></div></div></div>