On 10/19/2010 09:54 PM, Gustavo Sverzut Barbieri wrote:
> On Tue, Oct 19, 2010 at 10:47 AM, Mike McCormack
> <[email protected]>  wrote:
>>
>> Hi Raster,
>>
>> This is an attempt to fix the epoll/fork() issue reported to me where
>> we end up with a single epoll fd shared between two processes after  a
>> fork() in E.
>>
>> I've tested with elementary test in epoll and non-epoll combinations,
>> and all appears to be well.  Please check it solves the issue you saw,
>> and reformat the code as you see fit... ;-)
>
> Well, it may work, but this is not the way to go with it. IMO the
> correct way would be to tell for sure ecore it is being executed from
> a fork, but another option is to use epoll_create1(EPOLL_CLOEXEC),
> then handle the EBADF in select, recreating it upon errors (just be
> warned that may happen that the fd number is reused by the app if it
> open fds before going back to main loop)

Well, the problem is that there's no exec().  Somewhere E does a fork()
and dlopen() to load a plugin quickly.

I could add checks around all the forks in the codebase, but this way seems
more reliable.

The EBADF problem can be solved by reinitializing epoll when we get that
return from epoll_add, though the root cause is closing an fd before
removing it from ecore.

thanks,

Mike

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to