From dev-return-7626-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Aug 05 01:23:34 2002 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 70461 invoked by uid 500); 5 Aug 2002 01:23:32 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 70388 invoked from network); 5 Aug 2002 01:23:27 -0000 From: "Rob Saccoccio" To: Cc: , Subject: [PATCH] apr_poll.h (choosing between the APIs) Date: Sun, 4 Aug 2002 21:23:35 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N The following patch incorporates Brian's and Ryan's comments regarding choosing between the two poll APIs. --rob Index: apr_poll.h =================================================================== RCS file: /home/cvspublic/apr/include/apr_poll.h,v retrieving revision 1.5 diff -u -r1.5 apr_poll.h --- apr_poll.h 4 Aug 2002 04:43:23 -0000 1.5 +++ apr_poll.h 5 Aug 2002 01:19:24 -0000 @@ -55,11 +55,34 @@ #ifndef APR_POLL_H #define APR_POLL_H /** - * @file apr_network_io.h - * @brief APR Network library + * @file apr_poll.h + * @brief APR file/socket polling + * + * Two APIs are provided. The apr_pollset routines are intended to support + * repeated use of the pollset and are better for large numbers of + * descriptors (apr_poll is O(2n), apr_pollset is O(n)). To take advantage + * of it, you need to keep a handle on the pollset between calls to poll. + * In situations where it's prohibitively complex to maintain a pollset + * object, the apr_poll API is simpler to use. If you expect to call poll + * on a single descriptor repeatedly (and can maintain the pollset object), + * the apr_pollset API is more efficient than the apr_poll API. + * + * A reasonable rule of thumb for choosing between the poll APIs is: + * + * if ((very small number of file descriptors) + * && ((poll will NOT be repeated multiple times) + * || (application CANNOT keep track of a pollset object)) + * { + * use apr_poll API; + * } + * } + * else { + * use apr_pollset API; + * } */ + /** - * @defgroup APR_Net Network Routines + * @defgroup APR_Poll Functions * @ingroup APR * @{ */