New submission from Manjusaka <[email protected]>:
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
----------
components: Library (Lib)
messages: 331969
nosy: Manjusaka
priority: normal
severity: normal
status: open
title: enhhance for selector.EpollSelector
type: enhancement
versions: Python 3.7, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35517>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com