Realtime shield (#2194)
* cpu 3 shield
* set priority before affinity
* add to release files
* only run on android
old-commit-hash: b341fdc644
commatwo_master
parent
241ed1b312
commit
86bb0caf66
5 changed files with 21 additions and 1 deletions
@ -0,0 +1,16 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
import time |
||||||
|
from common.realtime import set_core_affinity, set_realtime_priority |
||||||
|
|
||||||
|
|
||||||
|
# RT shield - ensure CPU 3 always remains available for RT processes |
||||||
|
# runs as SCHED_FIFO with minimum priority to ensure kthreads don't |
||||||
|
# get scheduled onto CPU 3, but it's always preemptible by realtime |
||||||
|
# openpilot processes |
||||||
|
|
||||||
|
def main(): |
||||||
|
set_core_affinity(3) |
||||||
|
set_realtime_priority(1) |
||||||
|
|
||||||
|
while True: |
||||||
|
time.sleep(0.000001) |
Loading…
Reference in new issue