Skip to content

UI event loop: wake-driven multiplexing instead of try_recv polling #6146

Description

@Hmbown

From the 0.9.14 refactor backlog (async discipline pass).

tui/ui/event_loop.rs multiplexes by try_recv() on engine/dispatch/translation channels inside a poll loop with adaptive timeouts. It is well tuned, but still spin-and-sleep: input latency has a poll-interval floor and idle CPU never fully reaches zero.

Rust-native fix: wake-driven multiplexing — crossterm EventStream + tokio::select! over {input, engine rx, dispatch rx, timers}, or keep the dedicated UI thread and replace channel polling with a waker the producer pokes (futures::task::AtomicWaker). Keep the adaptive frame limiter; it is orthogonal. Verify first that nothing on the input path awaits send() into the 32-slot op channel (see the TurnSpec issue).

Size: M. Evidence: measured idle CPU and input latency before/after.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustPull requests that update rust codetuiTerminal UI behavior, rendering, or interaction

    Projects

    • Status
      Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions