[Xorp-hackers] question on some windows programming API

Steven Simpson ss at comp.lancs.ac.uk
Thu Sep 8 02:55:57 PDT 2011


On 07/09/11 17:08, Ben Greear wrote:
> On 09/07/2011 03:11 AM, Steven Simpson wrote:
>> So, I believe the code removes the identified
>> event from the array, and re-calls WaitFor* to pick out the next one.
>> Re-calls always use a zero timeout, since an event has already fired.
>
> That seems like a neat hack, but it's hard to believe the windows API
> is so inefficient as to require all of those system calls!

Yeah, though it might be as few as:

    * one call (with non-zero timeout) that identifies one event,
    * the second one (with zero timeout) that reports no more events.

...regardless of the number of handles submitted.

> It's also possible to use select in windows, but it only works on
> sockets I think...

That was my understanding too, hence I went looking into WaitFor*.

> so not sure I could add console (stdin?) to make
> xorpsh work properly, so I haven't tried to enable that yet...

It ought to be possible to get the HANDLE for stdin.  This looks promising:

<http://msdn.microsoft.com/en-us/library/ms685035%28v=VS.85%29.aspx>

Cheers,

Steven

-- 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20110908/f2ff05c7/attachment.html 


More information about the Xorp-hackers mailing list