summaryrefslogtreecommitdiffstats
path: root/runtime/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-10-22 13:54:40 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-10-22 13:54:40 +0200
commitcf38fc81759b01af5125b1a05e0d6fe8e2e1bc21 (patch)
tree534bfa946536dd45f3127912f268ee960c6a3285 /runtime/queue.c
parentb6f496f8619b02c50d3f5ced34eff279244b6e9b (diff)
downloadrsyslog-cf38fc81759b01af5125b1a05e0d6fe8e2e1bc21.tar.gz
rsyslog-cf38fc81759b01af5125b1a05e0d6fe8e2e1bc21.tar.xz
rsyslog-cf38fc81759b01af5125b1a05e0d6fe8e2e1bc21.zip
added a setting "$OptimizeForUniprocessor"
...to enable users to turn off pthread_yield calls which are counter-productive on multiprocessor machines (but have been shown to be useful on uniprocessors)
Diffstat (limited to 'runtime/queue.c')
-rw-r--r--runtime/queue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 7fa2df91..a3e29a96 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1285,6 +1285,7 @@ rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads,
/* we have an object, so let's fill the properties */
objConstructSetObjInfo(pThis);
+ pThis->bOptimizeUniProc = glbl.GetOptimizeUniProc();
if((pThis->pszSpoolDir = (uchar*) strdup((char*)glbl.GetWorkDir())) == NULL)
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
@@ -2208,8 +2209,10 @@ finalize_it:
/* the following pthread_yield is experimental, but brought us performance
* benefit. For details, please see http://kb.monitorware.com/post14216.html#p14216
* rgerhards, 2008-10-09
+ * but this is only true for uniprocessors, so we guard it with an optimize flag -- rgerhards, 2008-10-22
*/
- pthread_yield();
+ if(pThis->bOptimizeUniProc)
+ pthread_yield();
}
RETiRet;