Skip to content

Promote callback threads only while streams are active.#194

Open
kinetiknz wants to merge 1 commit intomasterfrom
thread-demote
Open

Promote callback threads only while streams are active.#194
kinetiknz wants to merge 1 commit intomasterfrom
thread-demote

Conversation

@kinetiknz
Copy link
Copy Markdown
Contributor

Previously the client and server callback threads were promoted to real-time priority for their entire lifetime. Promote on the 0->1 active-stream transition and demote on 1->0 so idle contexts don't hold RT priority.

Adds ipccore::EventLoopHandle::run_task to dispatch closures onto the event loop thread, since promote/demote must run on the target thread itself. Linux client demote is performed locally (SCHED_OTHER needs no privilege); the promote path still routes through the server via RPC.

Intended to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1784402 partially, along with mozilla/cubeb#843

Previously the client and server callback threads were promoted to real-time
priority for their entire lifetime.  Promote on the 0->1 active-stream
transition and demote on 1->0 so idle contexts don't hold RT priority.

Adds ipccore::EventLoopHandle::run_task to dispatch closures onto the event
loop thread, since promote/demote must run on the target thread itself.
Linux client demote is performed locally (SCHED_OTHER needs no privilege);
the promote path still routes through the server via RPC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant