Skip to content

Pin cpp_toolbelt to the QNX socketpair TriggerFd - #160

Open
dallison wants to merge 2 commits into
pin-coroutines-poll-maskfrom
pin-cpp-toolbelt-socketpair
Open

dallison wants to merge 2 commits into
pin-coroutines-poll-maskfrom
pin-cpp-toolbelt-socketpair

Conversation

@dallison

@dallison dallison commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Pin cpp_toolbelt to 10e2b042cb0e4602b8362d50612abf3c8b681ecc (dallison/cpp_toolbelt#32). TriggerFd is a Unix domain socketpair on QNX and a pipe on macOS and other POSIX systems. Linux stays on eventfd.
  • Based on the coroutines poll-mask pin. QNX still needs it: a socketpair reports POLLOUT while it is open, and co20_rpc waits on that fd for POLLIN.

On macOS, six opt rounds of //client:latency_test showed the socketpair slower when a publish wakes another thread (MultithreadedReliableLatency +11.7%, MultithreadedUnreliableLatency +21.2%) and about the same on a single thread. That is why this pin leaves macOS on the pipe.

Test plan

  • Bazel fetched 10e2b04 and the source keeps socketpair under __QNX__ / __QNXNTO__ and pipe otherwise.
  • //toolbelt:triggerfd_test in cpp_toolbelt passed on macOS, which builds the pipe path.
  • CI
  • QNX build.

On non-Linux POSIX, TriggerFd used a pipe. The qnx_pipes branch uses a Unix domain socketpair instead, which is what QNX and macOS need for the same poll behavior as eventfd.
macOS keeps the pipe. A socketpair was slower there when a publish wakes another thread, and QNX is the platform whose pipe service needs the socketpair.
@dallison dallison changed the title Pin cpp_toolbelt to the socketpair TriggerFd Pin cpp_toolbelt to the QNX socketpair TriggerFd Nov 15, 2026
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