POLL in different OSes

Gerhard Häring gh_pythonlist at gmx.de
Tue Oct 23 12:11:25 EDT 2001


On Tue, Oct 23, 2001 at 12:52:28PM -0300, Lucio Torre wrote:
> At 10:18 AM 23/10/2001 +0200, Gerhard Häring wrote:
> >On Mon, Oct 22, 2001 at 10:51:02PM -0300, Lucio Torre wrote:
> > >  From the documentation:
> > >
> > > "The poll() system call, supported on most Unix systems"
> > >
> > > and my questions:
> > >
> > > a) is poll supported on Windows?
> > >
> > > my guess is no, but i hoping for a yes.
> >
> >It isn't. Unless, you're using Cygwin. Also, select only works with
> >sockets on Windows.
> >
> >Wouldn't it be possible to emulate poll() with select()? I'd be glad to
> >see a patch appear at Sourceforge if that's possible :-)
> >
> >Gerhard
> 
> i think i could do that. i can make a .c with the code that emulates
> poll from select, if someone else is willing to make it a patch or
> whatever it should be to get into python.

That would be nice. I'd be willing to review, test, document and do the
patch submission at Sourceforge, if you want to avoid that.

> btw: is it worth it? poll is supposed to be faster, so why emulate it?
> it would have no reason to exist!

Consistency across platforms is a good reason to have it. I once wanted
to use a Python module using poll on Windows and had to rewrite it with
select. Had poll() been available on Windows, this wouldn't have been
necessary.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))




More information about the Python-list mailing list