Link to home
Start Free TrialLog in
Avatar of thready
thready

asked on

WaitForMultipleObjects - 2 timeouts?

Hi Experts,

I have the need for 2 separate timeouts as events coming back from WaitForMultipleObjects.  The normal timeout with WAIT_TIMEOUT is done.. How can I add a 2nd timeout event?  Perhaps a handle with some timer function that sets the event after a certain amount of time?

Thanks!
Mike
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thready
thready

ASKER

I don't think so- if timeout 2 is smaller, then it suffers... If I have one timeout of 10 seconds and the other is 30, I want the event to happen every 10 seconds and every 30 seconds...
Do the timeouts depend on which event fired? If so, you could use the event indicator that is returned to select the next timeout.

Alternatively, you could 'WaitForSingleObject()' in two separate threads...
Avatar of thready

ASKER

Yeap... I guess that's the best I can do with this.  Not giving up yet though... :-)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thready

ASKER

Thanks!  I'll be doing a hybrid of the "best solution".  There's one of the timeouts that is so unimportant and will be guaranteed to run less often than the other, so I'll just check if it's "time for that event too"... kinda thing...     :-)