Open asajeffrey opened 5 years ago
IRC chat with @jdm and @glennw: https://mozilla.logbot.info/servo/20190219#c15986149
As a work-around, we can avoid blocking the WebGL thread on the main thread (which is probably better for throughput anyway). https://github.com/asajeffrey/servo/commit/497455a780c8ae51795eaf96eecf2100fb0496d9
IRC monologue here: https://mozilla.logbot.info/servo/20190220#c15992836
Servo depends on a
blocks-on
relation to avoid deadlocks caused by cycles in threads blcoking on each other, as documented at https://github.com/servo/servo/blob/cc8a9fa92823010d2134ee9daf997bcbc33de41b/components/constellation/constellation.rs#L70-L78In particular, the compositor shouldn't end up blocking on canvas. This caused deadlock in trying to fix #22795, which (on macOS) means the
VRDisplay
has to render in the main thread, so the thread running the VR display has to block waiting on the main thread. Since presenting VR displays are run in the WebGL thread, this means addingcanvas can block on compositor
. This is fine as long as the compositor never blocks on canvas, but...This stack shows that webrender locks each external image, which calls https://github.com/servo/servo/blob/cc8a9fa92823010d2134ee9daf997bcbc33de41b/components/canvas/webgl_mode/inprocess.rs#L91-L104
This blocks waiting on the WebGL thread, and so the compositor thread ends up blocking on the canvas thread. Oops.