Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selectors: Plumb in kqueue user events instead of pipes for custom events #19587

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

elcritch
Copy link
Contributor

@elcritch elcritch commented Mar 6, 2022

This enables using kQueue EVFILT_USER for much faster user triggered events on MacOSX and likely *BSDs. Currently gated behind a new kqueue flag -d:kqueueUserEvent.

It's a little tricky to make it so the trigger function works on a kqueue custom event. I handled this by only enabling triggering once a custom event has been registered with a selector and is given that selector's kqueue FD. This may cause a bit of a race condition when closing that selector, though similar issues occur with pipe based events as well.

There's a bit of a question I had about whether a SelectEvent should support being added to multiple selectors. The current implementation only allows a user event to be registered with a single selector. On Linux SelectEvent's use eventfd and should work fine with multiple selectors & threads. Given that, it might be best to enable the kqueue-based user events to be registered with multiple selectors. That'd require using a sharedArray of kqueue FD's.

@elcritch
Copy link
Contributor Author

elcritch commented Mar 6, 2022

Note, I'd like to add a test before this is merged. However I wanted to open the PR so I could get feedback on whether multiple selector's should be supported.

@stale
Copy link

stale bot commented Mar 14, 2023

This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Mar 14, 2023
@stale stale bot closed this Apr 25, 2023
@Araq Araq removed the stale Staled PR/issues; remove the label after fixing them label Apr 26, 2023
@Araq Araq reopened this Apr 26, 2023
Copy link
Contributor

github-actions bot commented May 2, 2024

This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Staled PR/issues; remove the label after fixing them label May 2, 2024
Copy link
Contributor

github-actions bot commented Jun 8, 2024

This pull request has been marked as stale and closed due to inactivity after 395 days.

@github-actions github-actions bot closed this Jun 8, 2024
@Araq Araq reopened this Jun 8, 2024
@github-actions github-actions bot removed the stale Staled PR/issues; remove the label after fixing them label Aug 3, 2024
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.

None yet

3 participants