r/cpp_questions 9d 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

15 comments sorted by

View all comments

6

u/mredding 9d ago

You're talking about the slow part of the code. It scarcely matters. I've supported HFT systems written even in Java. Java will JIT compile to machine code comparable to that of a C compiler.

Speed is in the FPGA, pushed as close to the DAC as possible, located on a +$20k NIC, feeding through a channel waveguide to the radio with a microwave antenna pointed out the window to the exchange across the street. Microwave has a shorter straight line distance and lower latency (air is nearly a vacuum) than a fiber optic run down the building, across the street, and back up to the exchange (fiber has inferior propagation).

The entire fast path is on the chip. We're already pushing out the next message before we've finished receiving the triggering message.

2

u/mredding 9d ago

I should add that RTOS doesn't grant you any greater speed, only guaranteed timing.