8000 gh-127481: Add `EPOLLWAKEUP` to the `select` module by rruuaanng · Pull Request #127482 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127481: Add EPOLLWAKEUP to the select module #127482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 41 additions & 37 deletions Doc/library/select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,43 +280,47 @@ Edge and Level Trigger Polling (epoll) Objects

*eventmask*

+-------------------------+-----------------------------------------------+
| Constant | Meaning |
+=========================+===============================================+
| :const:`EPOLLIN` | Available for read |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLOUT` | Available for write |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLPRI` | Urgent data for read |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLERR` | Error condition happened on the assoc. fd |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
| | Level Trigger behavior |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
| | pulled out, the fd is internally disabled |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLEXCLUSIVE` | Wake only one epoll object when the |
| | associated fd has an event. The default (if |
| | this flag is not set) is to wake all epoll |
| | objects polling on a fd. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLRDHUP` | Stream socket peer closed connection or shut |
| | down writing half of connection. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLRDBAND` | Priority data band can be read. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLWRBAND` | Priority data may be written. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLMSG` | Ignored. |
+-------------------------+-----------------------------------------------+
+---------------------------+-----------------------------------------------+
| Constant | Meaning |
+===========================+===============================================+
| :const:`EPOLLIN` | Available for read |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLOUT` | Available for write |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLPRI` | Urgent data for read |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLERR` | Error condition happened on the assoc. fd |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
| | Level Trigger behavior |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
| | pulled out, the fd is internally disabled |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLEXCLUSIVE` | Wake only one epoll object when the |
| | associated fd has an event. The default (if |
| | this flag is not set) is to wake all epoll |
| | objects polling on a fd. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLRDHUP` | Stream socket peer closed connection or shut |
| | down writing half of connection. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLRDBAND` | Priority data band can be read. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLWRBAND` | Priority data may be written. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLMSG` | Ignored. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLL_URING_WAKE` | Optimizes event wake-up using io_uring. | |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLWAKEUP` | Prevents sleep during event waiting. | |
+---------------------------+-----------------------------------------------+

.. versionadded:: 3.6
:const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add the ``EPOLL_URING_WAKE``, ``EPOLLWAKEUP`` constants to the :mod:`select`
module.
6 changes: 6 additions & 0 deletions Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,12 @@ _select_exec(PyObject *m)
#ifdef EPOLLMSG
ADD_INT(EPOLLMSG);
#endif
#ifdef EPOLL_URING_WAKE
ADD_INT(EPOLL_URING_WAKE);
#endif
#ifdef EPOLLWAKEUP
ADD_INT(EPOLLWAKEUP);
#endif

#ifdef EPOLL_CLOEXEC
ADD_INT(EPOLL_CLOEXEC);
Expand Down
Loading
0