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

Issue 2399213005: TaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask. (Closed)

Created:
4 years, 2 months ago by fdoray
Modified:
4 years, 2 months ago
Reviewers:
robliao, gab
CC:
chromium-reviews, gab+watch_chromium.org, robliao+watch_chromium.org, fdoray+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

TaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask. Sequence::TakeTask() transfers ownership of the Task in the front slot of the Sequence to the caller. This makes the front slot empty. The empty front slot can be removed with Sequence::RemoveFrontSlot(). Benefits of transfering ownership of a Task to code that runs it: - The code that runs (and owns) the Task can modify it. This is important if we want to use OnceClosure in TaskScheduler. - It is now clear that a single thread has a pointer to a given Task at a time (before, multiple threads calling PeekTask on the same Sequence could theoretically get pointers to the same Task). BUG=553459 Committed: https://crrev.com/0c97aa3cb8c7710bdbc7d22c260a4d871f41e264 Cr-Commit-Position: refs/heads/master@{#424719}

Patch Set 1 #

Patch Set 2 : self-review #

Total comments: 14

Patch Set 3 : CR gab #3 #

Patch Set 4 : self-review #

Total comments: 10

Patch Set 5 : CR robliao #5 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+256 lines, -229 lines) Patch
M base/task_scheduler/scheduler_service_thread.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M base/task_scheduler/scheduler_worker.h View 1 2 3 4 1 chunk +5 lines, -4 lines 0 comments Download
M base/task_scheduler/scheduler_worker.cc View 1 2 3 4 1 chunk +6 lines, -5 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl.cc View 1 2 3 4 3 chunks +7 lines, -6 lines 0 comments Download
M base/task_scheduler/scheduler_worker_stack_unittest.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M base/task_scheduler/scheduler_worker_unittest.cc View 1 2 3 4 9 chunks +36 lines, -29 lines 0 comments Download
M base/task_scheduler/sequence.h View 1 2 3 4 3 chunks +22 lines, -12 lines 0 comments Download
M base/task_scheduler/sequence.cc View 1 2 1 chunk +20 lines, -25 lines 0 comments Download
M base/task_scheduler/sequence_unittest.cc View 1 2 5 chunks +56 lines, -64 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl.cc View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M base/task_scheduler/task_tracker.h View 1 chunk +1 line, -1 line 0 comments Download
M base/task_scheduler/task_tracker.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/task_scheduler/task_tracker_unittest.cc View 1 2 23 chunks +92 lines, -74 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 26 (10 generated)
fdoray
PTAL
4 years, 2 months ago (2016-10-07 19:21:36 UTC) #2
gab
Awesome :-) -- I guess we'll keep the modification of TaskTracker to fix shutdown ordering ...
4 years, 2 months ago (2016-10-07 19:51:08 UTC) #3
fdoray
Ordering of task destruction and shutdown bookkeeping will be fixed in a separate CL. https://codereview.chromium.org/2399213005/diff/20001/base/task_scheduler/sequence.cc ...
4 years, 2 months ago (2016-10-07 20:30:31 UTC) #4
robliao
Approach looks reasonable. https://codereview.chromium.org/2399213005/diff/60001/base/task_scheduler/scheduler_worker.h File base/task_scheduler/scheduler_worker.h (right): https://codereview.chromium.org/2399213005/diff/60001/base/task_scheduler/scheduler_worker.h#newcode59 base/task_scheduler/scheduler_worker.h:59: virtual void DidRunTask(TaskPriority task_priority, Since we're ...
4 years, 2 months ago (2016-10-07 20:57:12 UTC) #5
gab
lgtm
4 years, 2 months ago (2016-10-07 21:10:34 UTC) #6
fdoray
robliao@: PTAnL https://codereview.chromium.org/2399213005/diff/60001/base/task_scheduler/scheduler_worker.h File base/task_scheduler/scheduler_worker.h (right): https://codereview.chromium.org/2399213005/diff/60001/base/task_scheduler/scheduler_worker.h#newcode59 base/task_scheduler/scheduler_worker.h:59: virtual void DidRunTask(TaskPriority task_priority, On 2016/10/07 20:57:11, ...
4 years, 2 months ago (2016-10-11 12:29:19 UTC) #7
robliao
lgtm
4 years, 2 months ago (2016-10-11 17:12:43 UTC) #8
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/2399213005/80001
4 years, 2 months ago (2016-10-11 17:14:39 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/84192)
4 years, 2 months ago (2016-10-11 17:24:53 UTC) #13
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/2399213005/80001
4 years, 2 months ago (2016-10-11 18:36:22 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/84299)
4 years, 2 months ago (2016-10-11 18:47:57 UTC) #17
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/2399213005/80001
4 years, 2 months ago (2016-10-11 19:40:59 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/84371)
4 years, 2 months ago (2016-10-11 19:53:56 UTC) #21
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/2399213005/80001
4 years, 2 months ago (2016-10-12 12:15:23 UTC) #23
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 2 months ago (2016-10-12 12:21:52 UTC) #24
commit-bot: I haz the power
4 years, 2 months ago (2016-10-12 12:24:09 UTC) #26
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/0c97aa3cb8c7710bdbc7d22c260a4d871f41e264
Cr-Commit-Position: refs/heads/master@{#424719}

Powered by Google App Engine
This is Rietveld 408576698