include/threads: expose min,max prio values to userspace#791
include/threads: expose min,max prio values to userspace#791adamgreloch wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces global scheduling constants PH_MAX_PRIO and PH_MIN_PRIO in include/threads.h and refactors proc/threads.c to use them instead of local macros and hardcoded values. The reviewer suggested adding documentation to clarify that scheduling priorities are inverted (where 0 is the highest priority and 7 is the lowest) to prevent potential misunderstandings by developers.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Pthreads need to validate sched_param->sched_priority values. It'd be best not to hardcode the bounds in libphoenix. TASK: RTOS-1353
9a903bc to
0a3270a
Compare
|
|
||
|
|
||
| /* NOTE: lower numerical values represent more critical scheduling priorities */ | ||
| #define PH_MAX_PRIO 7 /* least-critical priority */ |
There was a problem hiding this comment.
I would avoid exposing these constants in the public API and introducing a new PH_* naming scheme unless they are required by external applications. For now, they can be moved to the source file.
|
This API is problematic e.g. when considering changing priorities number, as it requires recompilation of both kernel and userspace programs with new headers to keep compatibility. |
Pthreads need to validate sched_param->sched_priority values. It'd be best not to hardcode the bounds in libphoenix.
TASK: RTOS-1353
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment