summaryrefslogtreecommitdiffstats
path: root/lib/workqueue.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 02:58:10 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 02:58:10 +0200
commit50596be0d5ff65c79060bcd858cda33a974a0dc1 (patch)
tree4c5532f9924f9afc47af95d3cdfa7141e4e901c9 /lib/workqueue.h
parentAdd replace-as option to remove-private-as (diff)
downloadfrr-50596be0d5ff65c79060bcd858cda33a974a0dc1.tar.xz
frr-50596be0d5ff65c79060bcd858cda33a974a0dc1.zip
Some small enhancements to thread and workqueue libraries in zebra:
- Allow work queues to specify the yield duration for corresponding background thread - Support using specified yield duration in thread yielding - During work queue processing, if using a single list element with a meta-queue (like done in Zebra), do not exit after each element is processed, instead update the next-node upon a WQ_REQUEUE so that the WQ processing continues and is terminated by the yield logic. - Enhance work queue debug output
Diffstat (limited to 'lib/workqueue.h')
-rw-r--r--lib/workqueue.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/workqueue.h b/lib/workqueue.h
index f59499a0a..7d9a877d1 100644
--- a/lib/workqueue.h
+++ b/lib/workqueue.h
@@ -84,11 +84,14 @@ struct work_queue
unsigned int max_retries;
unsigned int hold; /* hold time for first run, in ms */
+
+ unsigned long yield; /* yield time in us for associated thread */
} spec;
/* remaining fields should be opaque to users */
struct list *items; /* queue item list */
unsigned long runs; /* runs count */
+ unsigned long yields; /* yields count */
struct {
unsigned int best;