diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-19 17:58:10 -0700 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-19 17:58:10 -0700 |
| commit | 50596be0d5ff65c79060bcd858cda33a974a0dc1 (patch) | |
| tree | 4c5532f9924f9afc47af95d3cdfa7141e4e901c9 /lib/thread.h | |
| parent | 5000f21c25dd13d12c3a00b5e702d6f79685a77e (diff) | |
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/thread.h')
| -rw-r--r-- | lib/thread.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h index bc7eaef447..f47dc92350 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -85,6 +85,7 @@ struct thread int index; /* used for timers to store position in queue */ struct timeval real; struct cpu_thread_history *hist; /* cache pointer to cpu_history */ + unsigned long yield; /* yield time in us */ char funcname[FUNCNAME_LEN]; }; @@ -209,6 +210,8 @@ extern void thread_call (struct thread *); extern unsigned long thread_timer_remain_second (struct thread *); extern int thread_should_yield (struct thread *); extern unsigned long timeval_elapsed (struct timeval a, struct timeval b); +/* set yield time for thread */ +extern void thread_set_yield_time (struct thread *, unsigned long); /* Internal libzebra exports */ extern void thread_getrusage (RUSAGE_T *); |
