Fix: only wait if work queue is empty in real-time mode
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Dec 2018 22:06:39 +0000 (17:06 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 9 Dec 2018 11:52:51 +0000 (06:52 -0500)
commit803e59362b6d94edff3a36f47a9da3e8dca4bde2
tree4c7f8aa105d7b21e82451fc8e19db14fff41a547
parent79eca0929fc50a668a15937b5bf4d1cb97049de8
Fix: only wait if work queue is empty in real-time mode

Unconditionally waiting for 10 ms after the completion of every batch
of jobs of the work queue in real-time mode appears to be a behaviour
inherited from the call-rcu thread.

While this is a fair trade-off in the context of call-rcu, it is less
evident that it is desirable in the context of a general-purpose
work queue. Waiting when work is available artificially degrades the
latency characteristics of the work queue.

If a workqueue user even need the explicit delay for batching (e.g. if
a call-rcu implementation would ever use the workqueue worker thread),
it can add it within the worker_before_wait_fct callback received as
argument from workqueue creation.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/workqueue.c
This page took 0.024898 seconds and 4 git commands to generate.