Need a way to assert that CPU heavy tasks are allowed |
||
Issue descriptionContext CL: https://chromium-review.googlesource.com/c/chromium/src/+/1191185 Use case: An expensive function wants to make sure it's not running on the UI thread so the expensive operations don't block that thread (or any important thread that should not be stalled). AssertBlockingAllowed() is not meant for this use case: it assumes that the expensive operation is off-CPU. I suggest we implement a new assertion, something like AssertExpensiveWorkAllowed(), which fails on special threads (UI, IO).
,
Sep 21
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1 commit 5b5cddb4d27e27e49efc5ad29dfcb725d93742e1 Author: Etienne Pierre-Doray <etiennep@chromium.org> Date: Fri Sep 21 15:28:07 2018 [TaskScheduler]: Implement AssertLongCPUWorkAllowed. Use case: An expensive function wants to make sure it's not running on the UI thread so the expensive operations don't block that thread. This assertion fails on threads other than scheduler workers. Bug: 879181 Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs Change-Id: I2a7ec2442c2020da4d68605c2476a01d25a45a33 Reviewed-on: https://chromium-review.googlesource.com/1221787 Reviewed-by: François Doray <fdoray@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Eugene But <eugenebut@chromium.org> Reviewed-by: Gabriel Charette <gab@chromium.org> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org> Cr-Commit-Position: refs/heads/master@{#593191} [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/base/threading/thread_restrictions.cc [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/base/threading/thread_restrictions.h [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/base/threading/thread_restrictions_unittest.cc [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/content/browser/browser_main_loop.cc [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/content/browser/browser_process_sub_thread.cc [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/ios/web/app/web_main_loop.mm [modify] https://crrev.com/5b5cddb4d27e27e49efc5ad29dfcb725d93742e1/ios/web/web_thread_impl.cc
,
Sep 24
|
||
►
Sign in to add a comment |
||
Comment 1 by gab@chromium.org
, Sep 10