summaryrefslogtreecommitdiffstats
path: root/runtime/wti.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-04-22 15:06:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-04-22 15:06:45 +0200
commit7667845bd72b6f92eabc975318a4f288a77f2630 (patch)
tree54b839ee7b3ae5347145bf4c721600ce5ca411b5 /runtime/wti.h
parentb0cfe39c851de0851d88e1b6a51bf40a76fb8304 (diff)
downloadrsyslog-7667845bd72b6f92eabc975318a4f288a77f2630.tar.gz
rsyslog-7667845bd72b6f92eabc975318a4f288a77f2630.tar.xz
rsyslog-7667845bd72b6f92eabc975318a4f288a77f2630.zip
first attempt at dequeueing multiple batches inside the queue
... but this code has serious problems when terminating the queue, also it is far from being optimal. I will commit a series of patches (hopefully) as I am on the path to the final implementation.
Diffstat (limited to 'runtime/wti.h')
-rw-r--r--runtime/wti.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/wti.h b/runtime/wti.h
index 6b60b833..85c98fe6 100644
--- a/runtime/wti.h
+++ b/runtime/wti.h
@@ -1,6 +1,6 @@
/* Definition of the worker thread instance (wti) class.
*
- * Copyright 2008 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2008, 2009 by Rainer Gerhards and Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
@@ -28,13 +28,25 @@
#include "wtp.h"
#include "obj.h"
+/* the user pointer array object
+ * This object is used to dequeue multiple user pointers which are than handed over
+ * to processing. The size of elements is fixed after queue creation, but may be
+ * modified by config variables (better said: queue properties).
+ * rgerhards, 2009-04-22
+ */
+struct aUsrp_s {
+ int nElem; /* actual number of element in this entry */
+ obj_t **pUsrp; /* actual elements (array!) */
+};
+
+
/* the worker thread instance class */
typedef struct wti_s {
BEGINobjInstance;
int bOptimizeUniProc; /* cache for the equally-named global setting, pulled at time of queue creation */
pthread_t thrdID; /* thread ID */
qWrkCmd_t tCurrCmd; /* current command to be carried out by worker */
- obj_t *pUsrp; /* pointer to an object meaningful for current user pointer (e.g. queue pUsr data elemt) */
+ aUsrp_t *paUsrp; /* pointer to an object array meaningful for current user pointer (e.g. queue pUsr data elemt) */
wtp_t *pWtp; /* my worker thread pool (important if only the work thread instance is passed! */
pthread_cond_t condExitDone; /* signaled when the thread exit is done (once per thread existance) */
pthread_mutex_t mut;