M
Mike
Hello,
Here is my challenge.
I have a thread awaiting events being sent via Queue. Currently I am
checking the count and if there is a count, Dequeue() the next object
and process it. By design, however, this is inefficient usage of CPU
clocks.
A more efficient usage could be to wrap Monitor::Wait() and
Monitor:
ulse() events. If Monitor operations like I think it does, I
should be able to Wait() efficiently forever for the next event to
arrive and before I Dequeue() it. And use Pulse() to signal when a
next event has been Enqueue()d.
Does Wait() wait efficiently for the next pulse to arrive?
Are pulses queued cumulatively?
Or is there only one state (pulsed or not)?
(Not insurmountable if this cannot happen.)
Best regards,
Michael Powell
Here is my challenge.
I have a thread awaiting events being sent via Queue. Currently I am
checking the count and if there is a count, Dequeue() the next object
and process it. By design, however, this is inefficient usage of CPU
clocks.
A more efficient usage could be to wrap Monitor::Wait() and
Monitor:

should be able to Wait() efficiently forever for the next event to
arrive and before I Dequeue() it. And use Pulse() to signal when a
next event has been Enqueue()d.
Does Wait() wait efficiently for the next pulse to arrive?
Are pulses queued cumulatively?
Or is there only one state (pulsed or not)?
(Not insurmountable if this cannot happen.)
Best regards,
Michael Powell