Make the use of the pthread_attr_setschedpolicy optional for linux #404
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#404
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, we try to set the scheduling policy which allows us to set the priorities. For a normal machine this needs root rights or at least a privilige for the binary. This might be unessecary for test purposes on a normal Linux computer. I would suggest:
I think this is good. Can the developer still use the priority system going from 1 to 99 or is this other nice schedule priority system used?
Hm I think for now we should use the 1 to 99 System for compability with other OS in the case the scheduler is used.
I think it might then be necessary to convert 1-99 to the nice values:
https://medium.com/@chetaniam/a-brief-guide-to-priority-and-nice-values-in-the-linux-ecosystem-fb39e49815e0
But I am not sure.
Hm nice values are caped for non-root users. We could map that to 0-19
Another issue:
https://man7.org/linux/man-pages/man7/sched.7.html under Autogroup:
So, we could use the function beaneath to set the nice values. We could recalculate the values to be in range 0,19.
https://man7.org/linux/man-pages/man2/nice.2.html
But at least on my machine getrlimit does not return any sensible thing:
Gives me a 20. So both are 0. Therefore, I would have to change the limits if I am right.
Ok and I can not set the limits. So, for now lets not set the nice limits
What about the other scheduling policies like
SCHED_IDLE
orSCHED_DEADLINE
? There is also the option to let the user chose those by using something similar how it was done for Windows: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/mueller/master/osal/windows/winTaskHelpers.cpp
Unconfirmed: The change of schedule policies always needs the privileges to do so. The whole reason for this issue was to be able to execute it without root or privileges.
Quote from MS:
So, even on Windows you need at least some access rights, which makes sense because one application could block your whole system.
Part of Makes linux realtime optional #406