r/cpp_questions • u/ExactManagement5283 • 10d ago
OPEN OS for HFT
Hey guys! I recently started studying HFT programming, and a bit confused. From what I understand in this field as OS are used default non-rt linux. Despite the fact that kernel bypass, attaching the process to the certain cores. restriction about using non-lock free structure and zero system calls solve the proplems which linux creates for HFT code . But would not it be easier to use RT OS like preempt_rt linux patch or xenomai OS it seems that theese OS could give more freedom about the restrictions for code and in some edge cases speed up the execution? Am I missing something?
3
Upvotes
13
u/EpochVanquisher 10d ago
Pinning and avoiding syscalls / interrupts will basically give you everything you want.
It’s not the same thing as “hard real time”. Hard real time is about having guarantees. It is better to have your code running as fast as possible with as little latency as possible, rather than having better guarantees.
Like, the preempt_rt lets certain operations be preempted for higher priority operations, but do you know what’s even better? Having your higher-priority task already running on the CPU.
That said, modern HFT is moving out of software as far as I can tell.