Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 690706 Split "Create" and "Start" phases of TaskScheduler to allow tasks to be posted prior to it running
Starred by 2 users Project Member Reported by, Feb 9 Back to list
Status: Assigned
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature

issue 553459
issue 659191
issue 667892

Sign in to add a comment
Currently base/task_scheduler/post_task.h requires a TaskScheduler to be set for any of the APIs to work.

This has been a source of issues (crashes) for Chrome initialization as we find callers that occur before a TaskScheduler is actually set. To solve this issue once and for all, a default TaskScheduler should probably be set for later customization.

There are two main approaches considered:

1) A simple task scheduler without all of the bells and whistles of the main one.
2) A queuing task scheduler that will wait until the real one is instantiated and forward to that.
3) Allowing the current default task scheduler to queue and then adjust to environment parameters specified after construction.

Options (1) and (2) will require a handoff of the in-flight tasks to the next task scheduler.

Option (3) will require adjusting the machinery to allow for parameter changes like maximum number of workers (currently we have an assumption that this doesn't change after construction).
Description: Show this description
Blocking: 667892 659191
Labels: -Pri-2 M-58 Pri-1
Status: Assigned
Summary: Split "Create" and "Start" phases of TaskScheduler to allow tasks to be posted prior to it running (was: Design and Implement TaskScheduler API Default Behavior)
This is required for M58 to make sure we don't have crashes after branch per an infrequent task being posted too early.

Let's prioritize this ahead of further migration work.
Project Member Comment 3 by, Mar 21 (5 days ago)
The following revision refers to this bug:

commit dafc3415b9ca6afe4c08690891e6331280ee7bbb
Author: fdoray <>
Date: Tue Mar 21 17:19:29 2017

Remove the |max_threads| argument from CreateAndSetSimpleTaskScheduler().

We want to change TaskSchedulerImpl so that it always has 4 thread pools. This
is incompatible with a CreateAndSetSimpleTaskScheduler() function that takes
a global maximum number of threads as argument. Therefore, this CL removes
that argument. Since existing callers didn't have comments to justify how the
value of this argument was chosen, they shouldn't care too much about this

This CL also adds a |name| argument to CreateAndSetSimpleTaskScheduler()
that is used to label threads and histograms associated with the created


Cr-Commit-Position: refs/heads/master@{#458450}


Sign in to add a comment