New issue
Advanced search Search tips

Issue 819742 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 804946
Owner: ----
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ScheduleMainThreadCleanup still called too often

Project Member Reported by rtoy@chromium.org, Mar 7 2018

Issue description

Issue 804946 fixed the main problem of calling this too often, but I think we still call this too often.   The audio thread calls HandleStoppableSourceNodes every render.  If there are finished source handlers, ScheduleMainThreadCleanup is called. If the main thread is loaded, it doesn't clear out finished source handlers very quickly, and the audio thread could pile up many many cleanups.

Maybe we should only schedule cleanups if there are finished handlers and if cleanups haven't been scheduled.  Then we don't pile up lots of cleanup tasks, making the main thread even busier.
 
Mergedinto: 804946
Status: Duplicate (was: Available)
> Maybe we should only schedule cleanups if there are finished handlers [1] and if cleanups haven't been scheduled [2].

[1]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp?type=cs&sq=package:chromium&l=720
[2]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp?type=cs&sq=package:chromium&l=840

These two checks are already in the code? What more could be done?

Comment 3 by rtoy@chromium.org, Mar 29 2018

Ah, has_posted_cleanup_task_ should be enough.  We're done here.

Sign in to add a comment