apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48491] New: pollset_remove() with kqueue is O(n)
Date Wed, 06 Jan 2010 04:34:10 GMT

           Summary: pollset_remove() with kqueue is O(n)
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: nrc@cs.berkeley.edu

In pollset_remove() for the kqueue pollset provider, there is a loop over a
linked list containing all the active pollfd_t's. I think this is a potentially
serious problem: one of the major advantages of kqueue is the ability to scale
to a large number of descriptors. O(n) on remove could potentially be very
expensive, especially since pollfd_t's need to be removed and re-added to
change their reqevents.

One way to fix this is to replace the linked list with a hash table, hashing on
the pollfd_t's "desc" field.

(The epoll provider has similar behavior, but at least that can be avoided by

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message