1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 22:01:47 +03:00
wezterm/window
Wez Furlong b83a63126c fix a starvation issue on linux/x11 systems
The `SpawnQueue::run_impl` would loop until it had exhausted
all queued items.  This prevents returning to the main loop
and resulted in the UI hanging while eg: `yes` was running,
and could also block accepting keyboard input, which is
pretty bad.

In addition, the queue implementation could fill up a pipe
and block the write side while it held a lock, which in
turn would prevent the read side from making room for the
write to succeed!

This commit changes the behavior on linux to change the wakeup
behavior of the queue from having a 1:1 relationship between
enqueue:wakeup to n:m where n and m are both >= 1.  This is
sufficient to wake a sleeping gui thread.  The gui thread
can then pop and process a single item at a time, interleaved
with dispatching the gui events.

The result is a bit more responsive, however, there is no
backpressure from the gui to the read side, so if the read
side is eating 2MB/s of data and the GUI side is processing
less than this, then an interrupt signal may still take a
few seconds to take effect.

I have mixed feelings about adding backpressure, because
I'm not sure that it is worth actually rendering all of
the parsed output text when there is a lot of it.

I need to follow up and verify these changes on macOS
and Windows too.

Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 16:53:01 -08:00
..
examples we can now init opengl but not render it 2019-10-10 08:15:00 -07:00
src fix a starvation issue on linux/x11 systems 2019-11-21 16:53:01 -08:00
build.rs window: use wgl for opengl on windows 2019-10-24 19:12:18 -07:00
Cargo.toml remove local workaround for core-foundation UB issue 2019-11-13 00:05:55 -08:00