bpo-41001: Add os.eventfd()#20930
Conversation
2891141 to
307cf27
Compare
June 17, 2020 17:28
|
Thanks for working on this, Tiran. It seems like it would be worthwhile to add a brief What's New entry for the addition of |
Sorry, something went wrong.
|
I have updated the documentation, added a select() test case, and included eventfd_read + eventfd_write helper functions. They are just too useful to omit them. |
Sorry, something went wrong.
pitrou
left a comment
There was a problem hiding this comment.
This is nice, though I suspect eventfd_read does a system call even when uncontended?
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! @pitrou: please review the changes made to this pull request. |
Sorry, something went wrong.
1c504ff to
5c9d03e
Compare
June 23, 2020 13:35
There was a problem hiding this comment.
LGTM (other than a minor suggested change for the whatsnew entry).
As mentioned in a previous review comment, I would prefer to have some mention in the docs of the specific use case for eventfd as a lightweight event notifier/waiter (essentially a brief summary of the "Notes" section from the man page) so that users are aware of its general functionality, even if they may not be already familiar with the system call. Unlike in the earlier years of Python, it's becoming increasingly common for developers to have started with Python before C (which has been my own experience). So, I think it's often quite helpful to at least have a summary of the purpose of the function, instead of assuming the reader is already familiar with it.
But IMO, it's fine to merge as is, that can potentially be considered as a future enhancement to the documentation. The core implementation of the wrapper, helpers, and the tests looks good to me.
(Note that I'm not particularly familiar with the details of implementing a CPython wrapper for a system call, I mainly used the existing members that work with FDs for comparison.)
Sorry, something went wrong.
50747e8 to
54c49fb
Compare
June 24, 2020 04:04
|
@tiran This is more of a question than it is feedback, but is there a particular reason why we don't link to a specific man page for additional information here? I see that it's not done for other similar members that are effectively just wrappers for system calls, but it seems like it would be quite useful for readers in this case (particularly since our documentation of it is just a brief summary). This could very easily be done using the |
Sorry, something went wrong.
|
I would suggest also to add a test using poll/epoll if available, but I don't feel strongly about it |
Sorry, something went wrong.
54c49fb to
bc99dd7
Compare
November 13, 2020 10:13
fcaa02c to
0cf9151
Compare
November 13, 2020 10:26
The ``eventfd_read`` and ``eventfd_write`` functions are convenient wrappers that perform proper read/write and conversion from/to uint64_t. Signed-off-by: Christian Heimes <christian@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
- initval is a uint32_t - improve documentation - add whatsnew Signed-off-by: Christian Heimes <christian@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
0cf9151 to
9c59140
Compare
November 13, 2020 10:28
|
@tiran: Please replace |
Sorry, something went wrong.
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue41001