From 97611d9f0a7809a759a0a0603f6d45f5822ad170 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 6 Nov 2005 13:32:11 +0000 Subject: Put common ioqueue functionalities in separate file to be used by both select() and epoll git-svn-id: http://svn.pjsip.org/repos/pjproject/main@12 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/ioqueue.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'pjlib/include/pj/ioqueue.h') diff --git a/pjlib/include/pj/ioqueue.h b/pjlib/include/pj/ioqueue.h index 6a7b827e..2e084fd3 100644 --- a/pjlib/include/pj/ioqueue.h +++ b/pjlib/include/pj/ioqueue.h @@ -82,11 +82,10 @@ PJ_BEGIN_DECL * * The items below describe rules that must be obeyed when using the I/O * queue, with regard to concurrency: - * - in general, the I/O queue is thread safe (assuming the lock strategy - * is not changed to disable mutex protection). All operations, except - * unregistration which is described below, can be safely invoked - * simultaneously by multiple threads. - * - however, care must be taken when unregistering a key from the + * - simultaneous operations (by different threads) to different key is safe. + * - simultaneous operations to the same key is also safe, except + * unregistration, which is described below. + * - care must be taken when unregistering a key from the * ioqueue. Application must take care that when one thread is issuing * an unregistration, other thread is not simultaneously invoking an * operation to the same key. @@ -205,11 +204,16 @@ typedef enum pj_ioqueue_operation_e } pj_ioqueue_operation_e; -/** - * Indicates that the I/O Queue should be created to handle reasonable - * number of threads. - */ -#define PJ_IOQUEUE_DEFAULT_THREADS 0 +/** + * This macro specifies the maximum number of events that can be + * processed by the ioqueue on a single poll cycle, on implementation + * that supports it. The value is only meaningfull when specified + * during PJLIB build. + */ +#ifndef PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL +# define PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL (16) +#endif + /** * Create a new I/O Queue framework. -- cgit v1.2.3