Commit d0648179 authored by Hongchan Choi's avatar Hongchan Choi Committed by Commit Bot

Use NORMAL priority thread for OfflineAudioWorkletThread

The BACKGROUND thread priority impl on Windows 7/10 is confusing [2],
and it seems very flaky [1]. The team agreed that using the NORMAL
priority thread for OfflineAudioWorkletThread is a sensible fix
for this.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1124980#c7
[2] https://analysis.chromium.org/p/chromium/flake-portal/flakes/occurrences?key=ag9zfmZpbmRpdC1mb3ItbWVyVgsSBUZsYWtlIktjaHJvbWl1bUBibGlua191bml0dGVzdHNAQXVkaW9Xb3JrbGV0VGhyZWFkUHJpb3JpdHlUZXN0LkNoZWNrVGhyZWFkUHJpb3JpdHkM

Bug: 1124980
Change-Id: I8b4063f9a6ee802cafd4a05daaec23bf5f0170d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411395Reviewed-by: default avatarRaymond Toy <rtoy@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807518}
parent dc3938b4
......@@ -318,12 +318,12 @@ constexpr ThreadPriorityTestParam kThreadPriorityTestParams[] = {
// for a real-time context.
{true, false, true, base::ThreadPriority::REALTIME_AUDIO},
// OfflineAudioWorkletThread is always a BACKGROUND priority no matter what
// OfflineAudioWorkletThread is always a NORMAL priority no matter what
// the flag setting or the originating frame level is.
{false, true, true, base::ThreadPriority::BACKGROUND},
{false, true, false, base::ThreadPriority::BACKGROUND},
{false, false, true, base::ThreadPriority::BACKGROUND},
{false, false, false, base::ThreadPriority::BACKGROUND},
{false, true, true, base::ThreadPriority::NORMAL},
{false, true, false, base::ThreadPriority::NORMAL},
{false, false, true, base::ThreadPriority::NORMAL},
{false, false, false, base::ThreadPriority::NORMAL},
};
class AudioWorkletThreadPriorityTest
......
......@@ -24,8 +24,8 @@ OfflineAudioWorkletThread::OfflineAudioWorkletThread(
ThreadCreationParams params =
ThreadCreationParams(ThreadType::kOfflineAudioWorkletThread);
// OfflineAudioWorkletThread always uses a BACKGROUND priority thread.
params.thread_priority = base::ThreadPriority::BACKGROUND;
// OfflineAudioWorkletThread always uses a NORMAL priority thread.
params.thread_priority = base::ThreadPriority::NORMAL;
if (++s_ref_count_ == 1)
EnsureSharedBackingThread(params);
......
......@@ -16,7 +16,7 @@ struct ThreadCreationParams;
// OfflineAudioWorkletThread is a per-AudioWorkletGlobalScope object that has a
// reference count to the backing thread that performs AudioWorklet tasks.
// Its backing thread uses BACKGROUND priority no matter what the environment
// Its backing thread uses NORMAL priority no matter what the environment
// or the feature flag setting is.
class MODULES_EXPORT OfflineAudioWorkletThread final : public WorkerThread {
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment