Todd Lipcon has submitted this change and it was merged.

Change subject: threadpool: Allow zero-size task queue
......................................................................


threadpool: Allow zero-size task queue

Previously, our threadpool implementation's concept of max_queue_size
was not very useful, and one could not specify a zero-size queue, because
we took the meaning of queue size quite literally, thus leaking an
implementation detail: we use the task queue to hand off tasks from the
user's thread to our worker threads.

Now, max_queue_size is more intuitive: the user is allowed to submit
(max_queue_size + max_threads) tasks before new submissions are
rejected (assuming no task completes in the mean time).

In this paradigm, a zero-size queue is a useful thing. It implies that
the total number of tasks running or queued at a given time will never
exceed max_threads, which under typical circumstances means that no
successfully-submitted task is left waiting for an executor for very
long.

Added a new functional test for max_queue_size = 0 and updated an
existing queue-related test that is now deterministic instead of being
racy.

Change-Id: I5abf40473ee813c625e0a02232d714aab2e65109
Reviewed-on: http://gerrit.cloudera.org:8080/5275
Reviewed-by: Todd Lipcon <[email protected]>
Tested-by: Kudu Jenkins
---
M src/kudu/util/threadpool-test.cc
M src/kudu/util/threadpool.cc
2 files changed, 35 insertions(+), 17 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5275
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5abf40473ee813c625e0a02232d714aab2e65109
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Mike Percy <[email protected]>
Gerrit-Reviewer: Dinesh Bhat <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to