Author vstinner
Recipients giampaolo.rodola, gvanrossum, neologix, vstinner, yselivanov
Date 2017-04-07.13:24:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491571444.46.0.308524635419.issue30014@psf.upfronthosting.co.za>
In-reply-to
Content
> Doesn't that mean doing 3 operations (unregister(), register(), modify()) instead of the current 2 (unregister(), register())? I don't see how it can be faster than a single modify() syscall.

The idea is to reuse _BaseSelectorImpl.register() and _BaseSelectorImpl.unregister() to factorize the code. These methods don't use syscall, they create the SelectorKey object and update _fd_to_key. So each class doesn't have to redo these things.

I don't insist to redo what I did, I'm just trying to explain my change because your change basically copy/paste the same code 3 times, and you forgot KqueueSelector, so you even may have to copy it a 4th time ;-)
History
Date User Action Args
2017-04-07 13:24:04vstinnersetrecipients: + vstinner, gvanrossum, giampaolo.rodola, neologix, yselivanov
2017-04-07 13:24:04vstinnersetmessageid: <1491571444.46.0.308524635419.issue30014@psf.upfronthosting.co.za>
2017-04-07 13:24:04vstinnerlinkissue30014 messages
2017-04-07 13:24:04vstinnercreate