* epoll_wait, epoll_ctl
@ 2006-01-13 13:38 Howard Chu
2006-01-13 16:12 ` Davide Libenzi
2006-01-13 22:51 ` David Schwartz
0 siblings, 2 replies; 3+ messages in thread
From: Howard Chu @ 2006-01-13 13:38 UTC (permalink / raw)
To: linux-kernel
So, what's supposed to happen in a threaded program where one thread
does an epoll_ctl on an epoll fd while another thread is currently
waiting in epoll_wait on the same fd? In particular, what happens if a
thread does an EPOLL_CTL_DEL on one of the fds that is currently being
waited on? Is there a possibility of an event being returned on the fd
even after the EPOLL_CTL_DEL completes?
--
-- Howard Chu
Chief Architect, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc
OpenLDAP Core Team http://www.openldap.org/project/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: epoll_wait, epoll_ctl
2006-01-13 13:38 epoll_wait, epoll_ctl Howard Chu
@ 2006-01-13 16:12 ` Davide Libenzi
2006-01-13 22:51 ` David Schwartz
1 sibling, 0 replies; 3+ messages in thread
From: Davide Libenzi @ 2006-01-13 16:12 UTC (permalink / raw)
To: Howard Chu; +Cc: linux-kernel
On Fri, 13 Jan 2006, Howard Chu wrote:
> So, what's supposed to happen in a threaded program where one thread does an
> epoll_ctl on an epoll fd while another thread is currently waiting in
> epoll_wait on the same fd? In particular, what happens if a thread does an
> EPOLL_CTL_DEL on one of the fds that is currently being waited on? Is there a
> possibility of an event being returned on the fd even after the EPOLL_CTL_DEL
> completes?
The same thing that happens when you close a file on another thread,
nothing (besides the file being automatically removed from the set).
Removing a file (either by close or by EPOLL_CTL_DEL) is not an event.
- Davide
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: epoll_wait, epoll_ctl
2006-01-13 13:38 epoll_wait, epoll_ctl Howard Chu
2006-01-13 16:12 ` Davide Libenzi
@ 2006-01-13 22:51 ` David Schwartz
1 sibling, 0 replies; 3+ messages in thread
From: David Schwartz @ 2006-01-13 22:51 UTC (permalink / raw)
To: linux-kernel
> So, what's supposed to happen in a threaded program where one thread
> does an epoll_ctl on an epoll fd while another thread is currently
> waiting in epoll_wait on the same fd?
Nothing special.
> In particular, what happens if a
> thread does an EPOLL_CTL_DEL on one of the fds that is currently being
> waited on? Is there a possibility of an event being returned on the fd
> even after the EPOLL_CTL_DEL completes?
Absolutely. The EPOLL_CTL_DEL might not even start until after the event
has been determined to be returned and the wait is in the process of
returning.
DS
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-13 22:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13 13:38 epoll_wait, epoll_ctl Howard Chu
2006-01-13 16:12 ` Davide Libenzi
2006-01-13 22:51 ` David Schwartz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox