apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Striker <stri...@apache.org>
Subject Re: [WIN32] alternative apr_pollset implementation proposal
Date Mon, 18 Apr 2005 18:04:55 GMT
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

Mime
View raw message