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

Feature request: support for sched_setscheduler #1183

Open
eglimi opened this issue Oct 15, 2024 · 2 comments
Open

Feature request: support for sched_setscheduler #1183

eglimi opened this issue Oct 15, 2024 · 2 comments

Comments

@eglimi
Copy link

eglimi commented Oct 15, 2024

There is currently no support for getting or setting the scheduling policies with sched_getscheduler and sched_setscheduler respectively. I use this on Linux with PREEMPT_RT to set realtime priorities and FIFO scheduling, currently with libc.

Other related parts are also not in rustix, e.g. to set the stack size (pthread).

Would you consider this in scope of rustix?

@sunfishcode
Copy link
Member

I'm not very familiar with pthread_setschedparam, but at first glance, it looks like it's more than just a trivial wrapper around sched_setscheduler, and it does things that only libc can do. I am familiar with pthread_attr_setstacksize, and I know that it's doing things that only libc can do. So it seems the best thing for users of these functions would be to continue to use libc.

If a safe interface to these functions is desired, it'd ideally go in a separate library from rustix, as it would just wrap libc and wouldn't require access to rustix's internals.

@eglimi
Copy link
Author

eglimi commented Oct 16, 2024

As a user, the ergonomics of rustix is very nice. Since libc is listed as a backend, I thought these APIs could be considered. What you write make sense though.

I leave this issue open in case anybody else wants to comment and will close it after a couple of days.
Thank you for your input and great work!

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

No branches or pull requests

2 participants