[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0803021342070.16600@alien.or.mcafeemobile.com>
Date: Sun, 2 Mar 2008 13:44:53 -0800 (PST)
From: Davide Libenzi <davidel@...ilserver.org>
To: Sam Varshavchik <mrsam@...rier-mta.com>
cc: linux-man@...r.kernel.org,
Michael Kerrisk <mtk.manpages@...glemail.com>,
Chris ¥¯ Heath <chris@...thens.co.nz>,
David Schwartz <davids@...master.com>, dada1@...mosbay.com,
Linux-Kernel@...r. Kernel. Org
<linux-kernel@...r.kernel.org>
Subject: Re: epoll design problems with common fork/exec patterns
On Sun, 2 Mar 2008, Sam Varshavchik wrote:
> Hijacking this epoll thread, the following related question occurs to me:
>
> #Q8
> # Does an operation on a file descriptor affect the already collected but
> #not yet reported events?
> #
> #A8
> # You can do two operations on an existing file descriptor. Remove would
> #be meaningless for this case. Modify will re-read available I/O.
>
> Why is EPOLL_CTL_DEL considered meaningless? A process is wrapping up its
> business and is preparing to remove the fd from the epoll set, and then close
> the file descriptor itself. In the meantime, the fd became readable, and a
> POLLIN event gets collected. So, what happens to the collected event, when the
> EPOLL_CTL_DEL operation is made?
Any epoll_wait() done after the POLLIN and before the EPOLL_CTL_DEL, will
show up. After the EPOLL_CTL_DEL, of course, no events will be reported.
- Davide
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists