Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Issue 2606193002: Use TaskScheduler instead of WorkerPool in fake_bluetooth_device_client.cc. (Closed)

Created:
3 years, 11 months ago by fdoray
Modified:
3 years, 11 months ago
Reviewers:
scheib
CC:
chromium-reviews, scheib+watch_chromium.org, ortuno+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use TaskScheduler instead of WorkerPool in fake_bluetooth_device_client.cc. The following traits are used: Priority: Inherited (default) The priority is inherited from the calling context (i.e. TaskTraits are initialized with the priority of the current task). Shutdown behavior: CONTINUE_ON_SHUTDOWN Tasks posted with this mode which have not started executing before shutdown is initiated will never run. Tasks with this mode running at shutdown will be ignored (the worker will not be joined). Note: Tasks that were previously posted to base::WorkerPool should use this shutdown behavior because this is how base::WorkerPool handles all its tasks. May Block: Tasks posted with MayBlock() may block. This includes but is not limited to tasks that wait on synchronous file I/O operations: read or write a file from disk, interact with a pipe or a socket, rename or delete a file, enumerate files in a directory, etc. This trait isn't required for the mere use of locks. BUG=659191 Review-Url: https://codereview.chromium.org/2606193002 Cr-Commit-Position: refs/heads/master@{#442891} Committed: https://chromium.googlesource.com/chromium/src/+/8f8b27e9d0744d90601d0dbb87a73470a03b01f4

Patch Set 1 #

Patch Set 2 : Add ScopedTaskScheduler #

Patch Set 3 : Add ScopedTaskScheduler #

Patch Set 4 : Add ScopedAsyncTaskScheduler #

Patch Set 5 : rebase #

Patch Set 6 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -5 lines) Patch
M device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M device/bluetooth/dbus/fake_bluetooth_device_client.cc View 2 chunks +7 lines, -3 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 32 (26 generated)
fdoray
PTAL
3 years, 11 months ago (2017-01-10 17:38:57 UTC) #24
scheib
LGTM, though this caused me to go read code comments for MayBlock. I suggest that ...
3 years, 11 months ago (2017-01-11 04:00:34 UTC) #25
fdoray
On 2017/01/11 04:00:34, scheib wrote: > LGTM, though this caused me to go read code ...
3 years, 11 months ago (2017-01-11 13:44:39 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2606193002/100001
3 years, 11 months ago (2017-01-11 13:45:12 UTC) #28
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/8f8b27e9d0744d90601d0dbb87a73470a03b01f4
3 years, 11 months ago (2017-01-11 13:49:42 UTC) #31
scheib
3 years, 11 months ago (2017-01-11 18:46:02 UTC) #32
Message was sent while issue was closed.
On 2017/01/11 13:44:39, fdoray wrote:
> On 2017/01/11 04:00:34, scheib wrote:
> > LGTM, though this caused me to go read code comments for  MayBlock.
> > 
> > I suggest that comment be expanded further to be more specific about what
> > 'locks' refers to in "This trait isn't required for the mere use of locks".
> Does
> > it mean lock primitives in src/base, or OS level locks, or what?
> 
> Any lock. You must use MayBlock() if your task blocks on things other than
locks
> and methods covered by WithBaseSyncPrimitives().
> 
> > 
> > Why should MayBlock trait be used, when should it be avoided? What impact
will
> > using it have? The current comment only partially answers this, explaining
> that
> > "tasks that wait on synchronous file I/O operations" will have it ... but
what
> > is the impact of that?
> 
> MayBlock() provides information about your task to TaskScheduler. We decided
not
> to document how TaskScheduler uses it in task_traits.h as this is an
> implementation detail that may change [1]. There is no reason to avoid using
> this trait, it just documents what your task does.
> 
> [1] When a MayBlock() task takes a long time to run, TaskScheduler considers
> that it is off-CPU and starts scheduling tasks on a new thread until it
> completes.

Thanks. I suggest adding a bit more to those comments -- even if not the
implementation impact, because it's still a bit not clear. Your write up here
helped me understand.

Powered by Google App Engine
This is Rietveld 408576698