You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2010/01/06 05:34:10 UTC

DO NOT REPLY [Bug 48491] New: pollset_remove() with kqueue is O(n)

https://issues.apache.org/bugzilla/show_bug.cgi?id=48491

           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
specifying APR_POLLSET_NOCOPY.)

-- 
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


DO NOT REPLY [Bug 48491] pollset_remove() with kqueue is O(n)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48491

--- Comment #1 from Neil Conway <nr...@cs.berkeley.edu> 2010-01-06 15:02:13 UTC ---
pollcb_remove() for the poll method appears to have the same property, BTW.

-- 
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