Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760103AbYCBVpT (ORCPT ); Sun, 2 Mar 2008 16:45:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757495AbYCBVpE (ORCPT ); Sun, 2 Mar 2008 16:45:04 -0500 Received: from x35.xmailserver.org ([64.71.152.41]:39361 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755641AbYCBVpB (ORCPT ); Sun, 2 Mar 2008 16:45:01 -0500 X-AuthUser: davidel@xmailserver.org Date: Sun, 2 Mar 2008 13:44:53 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Sam Varshavchik cc: linux-man@vger.kernel.org, Michael Kerrisk , =?X-UNKNOWN?Q?Chris_=C2=A5=C2=AF_Heath?= , David Schwartz , dada1@cosmosbay.com, =?UTF-8?B?TGludXgtS2VybmVsQFZnZXIuIEtlcm5lbC4=?= Org Subject: Re: epoll design problems with common fork/exec patterns In-Reply-To: Message-ID: References: <47C42CA7.4030607@gmail.com> <1204075804.5238.7.camel@linux.heathens.co.nz> X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1152 Lines: 31 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/