New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 757475 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Support BlockingType::MAY_BLOCK in SchedulerWorkerDelegateImpl

Project Member Reported by jeffreyhe@google.com, Aug 21 2017

Issue description

SchedulerWorkerDelegateImpl::BlockingScopeEntered and SchedulerWorkerDelegateImpl::BlockingScopeExited only supports BlockingType::WILL_BLOCK.

MAY_BLOCK should also be supported for calls that might or not might block.
 
Note: Some code has already been written to support this in

https://chromium-review.googlesource.com/c/589823
and
https://chromium-review.googlesource.com/c/594489

The approach in those CLs was to record a time stamp BlockingScopeEntered and then have the service thread poll workers to see if any increases in worker capacity is warranted.
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8

commit dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Sep 05 18:44:43 2017

Support BlockingType::MAY_BLOCK in SchedulerWorkerDelegateImpl.

Initially written by jeffreyhe@:
https://chromium-review.googlesource.com/c/chromium/src/+/633277

This CL adds support for BlockingType::MAY_BLOCK.
SchedulerWorkerDelegateImpl::BlockingScopeEntered() will record a
timestamp of when the worker was blocked. This
timestamp is used to determine whether a thread has been in the scope of
a ScopedBlockingCall long enough that |worker_capacity_| needs to be
increased. When the last idle worker gets woken up, a task will be posted
to the service thread that will cause these timestamps to be periodically
monitored.

In this CL, BlockingType::WILL_BLOCK will continue to have its
|worker_capacity_| increases be done immediately when ScopedBlockingCall
is instantiated.

Bug:  757475 
Change-Id: Ic7b5fc8c4d1f77adda48cafee262f3cbeff1711c
Reviewed-on: https://chromium-review.googlesource.com/639330
Commit-Queue: Francois Doray <fdoray@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499689}
[modify] https://crrev.com/dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8/base/task_scheduler/scheduler_worker_pool_impl.cc
[modify] https://crrev.com/dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8/base/task_scheduler/scheduler_worker_pool_impl.h
[modify] https://crrev.com/dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc
[modify] https://crrev.com/dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8/base/task_scheduler/scheduler_worker_pool_unittest.cc
[modify] https://crrev.com/dcbe7e7c4a00cfb5673e18f568aa2b9e4169b8e8/base/task_scheduler/task_scheduler_impl.cc

Comment 3 by gab@chromium.org, Apr 12 2018

Cc: jeffreyhe@google.com
Status: Fixed (was: Untriaged)
Fixed by jeffrey a while back in r499689.

Sign in to add a comment