This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients christian.heimes, felipecruz, giampaolo.rodola, gvanrossum, meador.inge, neologix, pitrou, python-dev, rosslagerwall, sbt, vstinner, yselivanov
Date 2015-02-05.09:07:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423127254.54.0.50965407827.issue18932@psf.upfronthosting.co.za>
In-reply-to
Content
> - 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?
History
Date User Action Args
2015-02-05 09:07:34vstinnersetrecipients: + vstinner, gvanrossum, pitrou, giampaolo.rodola, christian.heimes, meador.inge, neologix, rosslagerwall, python-dev, sbt, felipecruz, yselivanov
2015-02-05 09:07:34vstinnersetmessageid: <1423127254.54.0.50965407827.issue18932@psf.upfronthosting.co.za>
2015-02-05 09:07:34vstinnerlinkissue18932 messages
2015-02-05 09:07:33vstinnercreate