Search code examples
linuxlow-latency

Under Linux, is there any language that offers lower latency than C? (apart from assembler)


I've been looking at various languages (mostly functional) that offer some great potential for throughput and concurrency. However, for latency sensitive applications (by which I mean the potential to respond to an event < 1ms) seems to be beyond them.

I can do this in C, but I was wondering if anything had come along offering low latency and high concurrency, or are they (as I suspect) mutually exclusive?

Note: In a previous question there was a lot of discussion over the "mutually exclusive" bit - but I think it stands - if you need extremely low latency, you cannot get massive concurrency. I would absolutely love to be proven wrong on this! :-)


Solution

  • The difference between C and asm is unlikely to be a major factor in response latency. After all, before reaching your code, the system will have to run a fair bit of C code in the Linux kernel first, in order to schedule in your process. You'd be better off doing things like turning on threaded interrupt handlers, setting real-time priorities, and disabling BIOS features that may cause system-management-mode traps.