login
Header Space

 
 

Re: epoll design problems with common fork/exec patterns

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Davide Libenzi <davidel@...>
Cc: Chris "ク" Heath <chris@...>, David Schwartz <davids@...>, <dada1@...>, Linux-Kernel@Vger. Kernel. Org <linux-kernel@...>, <linux-man@...>
Date: Thursday, February 28, 2008 - 9:12 am

On Wed, Feb 27, 2008 at 8:35 PM, Davide Libenzi <davidel@xmailserver.org> wrote:

Okay -- removed.

But it is an ugly inconsistency.  On the one hand, a child process
cannot add the duplicate file descriptor to the epoll set.  (In every
other case that I can think of , descriptors duplicated by fork have
similar semantics to descriptors duplicated by dup() and friends.)  On
the other hand, the very fact that the child has a duplicate of the
descriptor means that even if the parent closes its descriptor, then
epoll_wait() in the parent will continue to receive notifications for
that descriptor because of the duplicated descriptor in the child.

The choice of [file *, fd] as the key for epoll sets really does seem
unfortunate.  Keying on [pid, fd] would have given saner semantics, it
seems to me.  Obviously it can't be changed now though.

Cheers,

Michael


-- 
Michael Kerrisk
Maintainer of the Linux man-pages project
http://www.kernel.org/doc/man-pages/
Want to report a man-pages bug?  Look here:
http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
epoll design problems with common fork/exec patterns, Marc Lehmann, (Sat Oct 27, 2:22 am)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Sat Oct 27, 12:59 pm)
RE: epoll design problems with common fork/exec patterns, David Schwartz, (Sun Oct 28, 12:47 am)
RE: epoll design problems with common fork/exec patterns, Davide Libenzi, (Sun Oct 28, 2:48 pm)
RE: epoll design problems with common fork/exec patterns, David Schwartz, (Sun Oct 28, 5:04 pm)
RE: epoll design problems with common fork/exec patterns, Davide Libenzi, (Mon Oct 29, 2:55 pm)
Re: epoll design problems with common fork/exec patterns, Michael Kerrisk, (Tue Feb 26, 11:13 am)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Tue Feb 26, 2:51 pm)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Wed Feb 27, 3:35 pm)
Re: epoll design problems with common fork/exec patterns, Michael Kerrisk, (Thu Feb 28, 9:12 am)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Thu Feb 28, 3:23 pm)
Re: epoll design problems with common fork/exec patterns, Michael Kerrisk, (Fri Feb 29, 11:46 am)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Fri Feb 29, 3:19 pm)
Re: epoll design problems with common fork/exec patterns, Michael Kerrisk, (Fri Feb 29, 3:54 pm)
Re: epoll design problems with common fork/exec patterns, Michael Kerrisk, (Thu Feb 28, 9:23 am)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Thu Feb 28, 3:34 pm)
Re: epoll design problems with common fork/exec patterns, Willy Tarreau, (Sat Oct 27, 1:38 pm)
Re: epoll design problems with common fork/exec patterns, Davide Libenzi, (Sat Oct 27, 2:01 pm)
speck-geostationary