I am experimenting with SCHED_FIFO
and I am seeing some unexpected behaviour. The server I am using has 12 cores with hyper-threading disabled. All configurable interrupts have been set to run on CPU 0.
My program starts creates a thread for lower priority tasks using the pthreads library without changing the scheduling policy with CPU affinity set to core 0. The parent thread then sets its CPU affinity to core 3 and its own scheduling policy to SCHED_FIFO
using sched_setscheduler()
with pid zero and priority 1 and then starts running a non-blocking loop.
The program itself runs well. However, if I attempt to log into the server for a second time while the program is running the terminal is unresponsive until I stop my program. It is like the scheduler is trying to run other processes on the same core as the real time process.
- What am I missing?
- Will the scheduler still attempt to run other processes on a core running a real time process? If so, is there a way to prevent this?
- Will setting the scheduling policy with
sched_setscheduler()
in the parent change the behaviour of the child that was created before?
Thanks in advance.