[Python-ideas] The async API of the future

Antoine Pitrou solipsis at pitrou.net
Sat Nov 3 00:54:00 CET 2012


On Sat, 3 Nov 2012 00:50:15 +0100
Sturla Molden <sturla at molden.no> wrote:
> >> 
> >> Or a simpler solution than nesting them into a tree: Let the calls to WaitForMultipleObjects time out at once, and loop over as many events as you need, polling 64 event objects simultaneously.
> > 
> > Well, that's basically O(number of objects), isn't it?
> > 
> 
> Yes, but nesting would be O(log64 n).

No, you still have O(n) calls to WaitForMultipleObjects, just arranged
differently.
(in other words, the depth of your tree is O(log n), but its number of
nodes is O(n))

Regards

Antoine.





More information about the Python-ideas mailing list