Message235426
> - drop SelectSelector._modify(): calling unregister() + register() is just fine
I checked with strace: PollSelector.modify() doesn't require any syscall, so I propose to also drop it (to just call unregister + register). What do you think?
I would like to reduce the number of syscalls, calling a C function of the glibc is cheap.
> This is a follow up of issue 16853 (see comment http://bugs.python.org/issue16853#msg196984).
"(...) the problem with unregister() + register() vs a real
modify (e.g. EPOLL_CTL_MOD) is that it's subject to a race condition,
if an event fires during the short window where the FD isn't
registered anymore."
The race condition only occurs with selectors which have a state machine in the kernel: epoll, kqueue, devpoll. SelectSelector and PollSelector are state-less (in the kernel, the state is build for a single syscall and then destroyed). Am I right? |
|
Date |
User |
Action |
Args |
2015-02-05 09:07:34 | vstinner | set | recipients:
+ vstinner, gvanrossum, pitrou, giampaolo.rodola, christian.heimes, meador.inge, neologix, rosslagerwall, python-dev, sbt, felipecruz, yselivanov |
2015-02-05 09:07:34 | vstinner | set | messageid: <1423127254.54.0.50965407827.issue18932@psf.upfronthosting.co.za> |
2015-02-05 09:07:34 | vstinner | link | issue18932 messages |
2015-02-05 09:07:33 | vstinner | create | |
|