Author Manjusaka
Recipients Manjusaka
Date 2018-12-17.10:31:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545042698.49.0.788709270274.issue35517@psf.upfronthosting.co.za>
In-reply-to
Content
Add a keyword argument for selector.EpollSelector with default value.

This can help people use the EPOLLEXCLUSIVE since Python 3.7 and Linux Kernel 4.5 to avoid the herd effect

like this

        def register(self, fileobj, events, data=None, exclusive=False):
            key = super().register(fileobj, events, data)
            epoll_events = 0
            if events & EVENT_READ:
                epoll_events |= select.EPOLLIN
            if events & EVENT_WRITE:
                epoll_events |= select.EPOLLOUT
            try:
                if exclusive and hasattr(select, "EPOLLEXCLUSIVE"):
                    epoll_events |= select.EPOLLEXCLUSIVE
                self._epoll.register(key.fd, epoll_events)
            except BaseException:
                super().unregister(fileobj)
                raise
            return key
History
Date User Action Args
2018-12-17 10:31:38Manjusakasetrecipients: + Manjusaka
2018-12-17 10:31:38Manjusakasetmessageid: <1545042698.49.0.788709270274.issue35517@psf.upfronthosting.co.za>
2018-12-17 10:31:38Manjusakalinkissue35517 messages
2018-12-17 10:31:38Manjusakacreate