This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: No API to get events from epoll without allocating a list
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: alex, christian.heimes, fijall, neologix, pitrou
Priority: normal Keywords:

Created on 2013-10-21 16:34 by alex, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg200810 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2013-10-21 16:34
select.epoll should expose an api such as `iterpoll` which returns an iterator over the ready events, rather than a list. Allocating a list is wasteful in many cases (e.g. twisted's event loop) and it'd be nice to have an API that was less wasteful.
msg201008 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-23 09:00
A list of a couple events should be very cheap to allocate. How many events do you get?
msg201009 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-23 09:08
How is iterpoll() suppose to work? Do epoll_wait() with maxevents=1 in a loop, yield (fd, event) tuples and stop/block on no events?
msg201040 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-10-23 16:46
I'm also skeptical: I doubt the list allocation weights much compared
to the syscall.
And like Christian, I'm curious to know which implementation you'd chose.
msg203186 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-11-17 14:45
@Alex: ping
History
Date User Action Args
2022-04-11 14:57:52adminsetgithub: 63535
2021-10-21 21:24:38iritkatrielsetstatus: open -> closed
resolution: rejected
stage: resolved
2013-11-17 14:45:48christian.heimessetmessages: + msg203186
2013-10-23 16:46:07neologixsetmessages: + msg201040
2013-10-23 09:08:33christian.heimessettype: enhancement
messages: + msg201009
components: + Extension Modules
versions: + Python 3.4
2013-10-23 09:02:30christian.heimessetnosy: + christian.heimes
2013-10-23 09:00:54pitrousetnosy: + pitrou
messages: + msg201008
2013-10-23 08:56:13pitrousetnosy: + neologix
2013-10-21 17:23:18fijallsetnosy: + fijall
2013-10-21 16:34:26alexcreate