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

Add TID support to sched_getaffinity/sched_setaffinity #4062

Open
RalfJung opened this issue Nov 26, 2024 · 0 comments
Open

Add TID support to sched_getaffinity/sched_setaffinity #4062

RalfJung opened this issue Nov 26, 2024 · 0 comments
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available

Comments

@RalfJung
Copy link
Member

Our sched_getaffinity/sched_setaffinity shims currently only support a pid of 0, indicating the current thread. However, now that we have gettid, we should support using a TID in sched_getaffinity/sched_setaffinity as well. We probably want some helper functions to convert between a LinuxTid and a ThreadId, to ensure this is consistent.

Note that gettid is Linux-specific, while we support sched_getaffinity/sched_setaffinity also on FreeBSD. This new support for non-0 pid should remain Linux-specific for now; gettid does not seem to be exposed by the libc on FreeBSD.

@RalfJung RalfJung added A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available
Projects
None yet
Development

No branches or pull requests

1 participant