Skip to content
Commit df643204 authored by François Doray's avatar François Doray Committed by Chromium LUCI CQ
Browse files

[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: default avatarJonathan Ross <jonross@chromium.org>
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312164}
parent 340da1e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment