Re: WaitForSingleObjectEx() is broken



Here is the problem as I see it, I have kept trying to find uses for
WFSO but have kept finding better ways to perform the same action. In
console mode the 2 styles of procedures I write are "wait for any key"
or "wait for a key and return the results". The first is done best
using a _kbhit polling loop and the second is done using 2 calls to
_getch, both being C runtime functions.

In both contexts WFSO is close enough to useless and worse, the data
you have suggested is from another API call ReadConsoleInput() and
there is no reference with WFSO for the capacity you suggest and this
includes the most current online MSDN information. I also have win2k
SDK reference and win32.hlp reference and none are different.

With big rewrites of win32 coming up in release versions of win64,
things you have tested in win32 run the risk of being implimented
differently after the rewrite with the usual comeback that it conforms
to documentation, not previous characteristics.

Polling is a technique, not a precanned API so it does not go out of
fashion or become subject to a rewrite and the wait based Sleep() API
yields back to the OS with the options of being conditional on other
running process priorities (0), yield a single timeslice (>1 but less
than timeslice in MS) or a longer yield period if the task being polled
is not in any sense time critical.

This is why it is superior technology, it is far less theory laden, not
tied to any particular family of functions, far more ajustable, is
properly multitasking friendly and proven as very efficient. The
tecnique will still be available when Windows is finished because it is
a fundamental programming tecnique. Like any technique used by a
programmer, it can be written well, written badly or be tailored to fit
the circumstances in which it is used.

Regards,

hutch at movsd dot com

.