summaryrefslogtreecommitdiff
path: root/pjlib/include/pj/config.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-02-13 15:17:28 +0000
committerBenny Prijono <bennylp@teluu.com>2008-02-13 15:17:28 +0000
commit379f21d67f143af70c85fd9ef2af67cc87d150e3 (patch)
tree4b20c85bf30f3d7aebbd94a3ef529e7ae9f42f59 /pjlib/include/pj/config.h
parenta2ca31f0f6e30a30bf6f6e58ab423b370fbc9bb3 (diff)
Ticket #474: option in ioqueue to control concurrency (to allow/disallow simultaneous/multiple callback calls)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1789 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/config.h')
-rw-r--r--pjlib/include/pj/config.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index bce870de..9a291608 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -285,6 +285,8 @@
# undef PJ_ENABLE_EXTRA_CHECK
# undef PJ_EXCEPTION_USE_WIN32_SEH
# undef PJ_HAS_ERROR_STRING
+
+# define PJ_HAS_IPV6 1
#endif
/**
@@ -513,6 +515,32 @@
/**
+ * Default concurrency setting for sockets/handles registered to ioqueue.
+ * This controls whether the ioqueue is allowed to call the key's callback
+ * concurrently/in parallel. The default is yes, which means that if there
+ * are more than one pending operations complete simultaneously, more
+ * than one threads may call the key's callback at the same time. This
+ * generally would promote good scalability for application, at the
+ * expense of more complexity to manage the concurrent accesses.
+ *
+ * Please see the ioqueue documentation for more info.
+ */
+#ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
+# define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY 1
+#endif
+
+
+/* Sanity check:
+ * if ioqueue concurrency is disallowed, PJ_IOQUEUE_HAS_SAFE_UNREG
+ * must be enabled.
+ */
+#if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG==0)
+# error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency \
+ is disabled
+#endif
+
+
+/**
* When safe unregistration (PJ_IOQUEUE_HAS_SAFE_UNREG) is configured in
* ioqueue, the PJ_IOQUEUE_KEY_FREE_DELAY macro specifies how long the
* ioqueue key is kept in closing state before it can be reused.