[Python-ideas] An alternate approach to async IO

Sturla Molden sturla at molden.no
Wed Nov 28 20:22:34 CET 2012

On 28.11.2012 20:11, Richard Oudkerk wrote:

> According to your (or Trent's) idea the main thread busy waits until the
> interlocked list is non-empty. If there is no work to do then the
> interlocked list is empty and the main thread will busy wait till there
> is work to do, which might be for a long time.

That would not be an advantage. Surely it should time-out or at least 
stop busy-waiting at some point...

But I am not sure if a list like Trent described is better than just 
calling GetQueuedCompletionStatusEx from the Python thread. One could 
busy-wait with 0 timeout for a while, and then at some point use a few 
ms timouts (1 or 2, or perhaps 10).

IOCPs set up a task queue, so I am back to thinking that stacking two 
task queues after each other does not help very much---


More information about the Python-ideas mailing list