Issue 19336: No API to get events from epoll without allocating a list (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/63535

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:52 admin set github: 63535
2021-10-21 21:24:38 iritkatriel set status: open -> closedresolution: rejectedstage: resolved
2013-11-17 14:45:48 christian.heimes set messages: +
2013-10-23 16:46:07 neologix set messages: +
2013-10-23 09:08:33 christian.heimes set type: enhancementmessages: + components: + Extension Modulesversions: + Python 3.4
2013-10-23 09:02:30 christian.heimes set nosy: + christian.heimes
2013-10-23 09:00:54 pitrou set nosy: + pitroumessages: +
2013-10-23 08:56:13 pitrou set nosy: + neologix
2013-10-21 17:23:18 fijall set nosy: + fijall
2013-10-21 16:34:26 alex create