Poll'able Queue objects.

Dan Maas dmaas at dcine.com
Mon Mar 12 00:55:04 EST 2001


> The mind wobbles.  One of the things that Unix got right is that you can
> select() (or poll()) on pipes, sockets, serial ports (any properly written
> character device that's properly written), or, in degenerate-case sort of
> way, "regular" files.

As much of a Unix fan as I am, we've got it worse... Pthreads condition
variables. SysV semaphores and message queues. Asynchronous disk I/O (POSIX
AIO). UNIX signals. None of these "waitable objects" can be multiplexed
together with file descriptors*... Also the "stateless" paradigm of select()
and poll() is not always preferable to "stateful" Windows message loops -
consider the problems involved with using two unrelated Unix libraries that
each want control of the main loop...

AFAIK MsgWaitForMultipleObjects() handles Win32 message queues, semaphores,
mutexes, async disk I/O, network I/O, etc. The API is not as clean but the
functionality is there =)

Dan

* well FreeBSD has kqueue, those lucky bastards =)





More information about the Python-list mailing list