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 robliao@chromium.org, Feb 9 Back to list
Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature

Blocking:
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
Owner: fdoray@chromium.org
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 bugdroid1@chromium.org, Mar 21 (5 days ago)
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dafc3415b9ca6afe4c08690891e6331280ee7bbb

commit dafc3415b9ca6afe4c08690891e6331280ee7bbb
Author: fdoray <fdoray@chromium.org>
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
change.

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

BUG=690706
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester

Review-Url: https://codereview.chromium.org/2729523006
Cr-Commit-Position: refs/heads/master@{#458450}

[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/base/task_scheduler/task_scheduler.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/base/task_scheduler/task_scheduler.h
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/chrome/app/mash/mash_runner.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/chrome/service/service_process.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/components/cronet/ios/cronet_environment.mm
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/content/child/child_process.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/client/chromoting_client_runtime.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/client/ios/app_runtime.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/host/it2me/it2me_native_messaging_host_main.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/host/remoting_me2me_host.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/host/setup/me2me_native_messaging_host_main.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/host/setup/start_host_main.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/remoting/test/chromoting_test_driver.cc
[modify] https://crrev.com/dafc3415b9ca6afe4c08690891e6331280ee7bbb/ui/ozone/demo/ozone_demo.cc

Sign in to add a comment