mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal] Set HAL Notifier thread as RT by default (#3482)
This PR gives the Notifier HAL thread RT priority 40 in RobotBase after HAL initialization and before the user code is run. This drastically improves scheduling jitter for TimedRobot's AddPeriodic() functions (in 3512's experience). It's too risky to set user code as RT because badly behaved code will lock up the Rio (potentially requiring safe mode to recover). This needs the user program to be setuid admin to succeed.
This commit is contained in:
@@ -20,7 +20,7 @@ namespace frc {
|
||||
int GetThreadPriority(std::thread& thread, bool* isRealTime);
|
||||
|
||||
/**
|
||||
* Get the thread priority for the current thread
|
||||
* Get the thread priority for the current thread.
|
||||
*
|
||||
* @param isRealTime Set to true if thread is real-time, otherwise false.
|
||||
* @return The current thread priority. For real-time, this is 1-99
|
||||
@@ -30,7 +30,7 @@ int GetThreadPriority(std::thread& thread, bool* isRealTime);
|
||||
int GetCurrentThreadPriority(bool* isRealTime);
|
||||
|
||||
/**
|
||||
* Sets the thread priority for the specified thread
|
||||
* Sets the thread priority for the specified thread.
|
||||
*
|
||||
* @param thread Reference to the thread to set the priority of.
|
||||
* @param realTime Set to true to set a real-time priority, false for standard
|
||||
@@ -43,7 +43,7 @@ int GetCurrentThreadPriority(bool* isRealTime);
|
||||
bool SetThreadPriority(std::thread& thread, bool realTime, int priority);
|
||||
|
||||
/**
|
||||
* Sets the thread priority for the current thread
|
||||
* Sets the thread priority for the current thread.
|
||||
*
|
||||
* @param realTime Set to true to set a real-time priority, false for standard
|
||||
* priority.
|
||||
|
||||
Reference in New Issue
Block a user