-
+
HOW TO AVOID DELAYS
Competition from other threads
- resetting a thread to use SCHED_FIFO scheduling ensures that
it will run until
- it blocks OR
- yields the processor OR
- a higher priority SCHED_FIFO thread becomes runnable
Page faults
- occur whenever app accesses a memory address that is not currently
resident in physical RAM
- disk I/O required to bring memory contents into RAM
mlockall(2)
prevents memory from being paged out of
RAM
- still necessary to touch memory before "critical use", because
allocated memory is not mapped to RAM until then.
Disk I/O
IRQ's blocked
- the kernel sometimes blocks all IRQ handling
- audio interface IRQ has a deadline for service. if interrupts
are blocked for too long, we miss the deadline OR make
it impossible to process the available data in time.
- user space can't do anything about this - it requires kernel
patches, fixes, redesigns.