RESOLVED FIXED263074
WebAudio: Limit the number of realtime audio threads, and constrain their runtime
https://bugs.webkit.org/show_bug.cgi?id=263074
Summary WebAudio: Limit the number of realtime audio threads, and constrain their run...
Jer Noble
Reported 2023-10-12 08:40:04 PDT
In 268047@main, RemoteAudioDestinationProxy threads were made to run in realtime mode, thereby avoiding audible stutters and dropouts in periods of high thread contention. However realtime threads come at a cost, and creating too many realtime threads is problematic from a kernel scheduling perspective. In some degenerate cases, sites can create many, many AudioContexts, each with their own realtime thread. Long term, this should be fixed via bug #263073, by coalescing compatable threads together. Until then, limit the number of concurrent realtime audio threads that can be created to 3, and adopt threading APIs (on Darwin OSs, for now) to constrain the runtime of these threads such that, when exceeded, the scheduler will demote the priority and runtime class of the thread to normal values.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-10-12 08:40:20 PDT
Jer Noble
Comment 2 2023-10-12 09:28:56 PDT
EWS
Comment 3 2023-10-12 18:53:26 PDT
Committed 269291@main (02ffbc50d8a6): <https://commits.webkit.org/269291@main> Reviewed commits have been landed. Closing PR #19000 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.