[Python-Dev] Re: Synchronous and Asynchronous servers in the standard library

Jp Calderone exarkun at divmod.com
Thu Nov 11 03:17:40 CET 2004

On 10 Nov 2004 20:28:46 -0500, David Bolen <db3l at fitlinxx.com> wrote:
>"Martin v. L�wis" <martin at v.loewis.de> writes:
> [snip]
> For my part, in terms of integrating non-socket sources, I'd probably
> be just as happy if Python permitted it's own Queue.Queue to be
> selectable, since then I could just have a separate thread with a
> native Win32 wait object loop, pumping information into the queue.
> But the basic nature of the fundamantal threading constructs Queue is
> built on would probably make that difficult, if possible at all.

  This isn't very difficult.  See _UnixWaker/_Win32Waker at in http://cvs.twistedmatrix.com./cvs/trunk/twisted/internet/default.py?view=markup&rev=12283&root=Twisted

  Building a "selectable Queue" on top of the "wakeUp" primitive is a handful of lines at most.  Of course, with the deferToThread() function already built on top of it, the selectable Queue concept doesn't seem quite as attractive anymore.


More information about the Python-Dev mailing list