William A. Rowe, Jr. wrote:
Sleep() is not the answer.

I do have a productive suggestion though that we kicked around once or
twice.  Spin up helper threads (we can even keep a cache of them) to
handle each group of 64 events, and have them pop an event to the
parent thread once finished.  at 64x63 events, this could be quite
respectible.

And when that proves not to be enough you can go for a slightly modified algorithm:

 while (len(events) > 64) {
   new_events = empty list;

   while (len(events) > 0)
     pop 64 events and hand them to a helper thread;
     note the thread in new_events;
   }

   events = new_events;
 }

 WaitForMultipleObjects(events)
 ...


The thing this doesn't solve is thread management ofcourse...


Sander

Reply via email to