POLL in different OSes
rharkins at thinkronize.com
Tue Oct 23 22:24:31 CEST 2001
If not a true poll emulator, I would like to see a C overlay on select that
would handle C-level selectable objects that would have flags on the objects
managed by C. This would mean that I wouldn't have to feed Pyhton lists to
select nor make select return three (possibly brand-spankin' new) lists as a
result. The way it would work in my twisted little universe is something
Create the polled objects...
Create the poller and add the polled...
Enable the events I want to know about...
Test the result...
>>> if obj1.has(PL_READ):
>>> # Read from obj1
>>> if obj2.has(PL_WRITE):
>>> # Write to obj2
This is more code, yes, than select but it could be implemented using either
C-select or C-poll depending on OS coditions. More importantly, lists did
not need to be fed to the poller nor does the poller produce new lists in
its operation. This should be a big win in performance (I think) over the
traditional Python select mechanism. I don't know the internals of the
Python implementation layer for select but I suspect this is the case.
Oh well, just wishful thinking...
More information about the Python-list