From 50596be0d5ff65c79060bcd858cda33a974a0dc1 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 19 May 2015 17:58:10 -0700 Subject: 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 --- lib/workqueue.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/workqueue.h') diff --git a/lib/workqueue.h b/lib/workqueue.h index f59499a0a7..7d9a877d10 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; -- cgit v1.2.3