[vsync] Add feature to bypass PostTask in ExternalBeginFrameSourceWin.
Today, ExternalBeginFrameSourceWin posts a task from the VSync thread to the VizCompositorThread on every VSync, which incurs some scheduling overhead. This CL adds a feature to use RunOrPostTask instead of PostTask. RunOrPostTask may run its callback synchronously, but it provides the same ordering and mutual exclusion guarantees as PostTask. To achieve that: - It only runs its callback synchronously if the target thread has no running or queued task. - It prevents the target thread from starting to run a task when running its callback synchronously. We'll run a field trial to measure the impact and decide if this is a worthwhile change. Bug: 40944462 Change-Id: Id6ad049792fc5ff3d9699782676112b634ab382e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502652 Reviewed-by:Jonathan Ross <jonross@chromium.org> Commit-Queue: Francois Pierre Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/main@{#1312164}
Loading
Please register or sign in to comment