开发者

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 开发者_如何学Pythonwrong on this! :-)


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.


What do you mean by latency? C is not much more than portable assembler. Most C instructions are directly mapped to processor instructions. C overhead is very minimal, compared to other languages. If you mean latency as in DSP programming, you probably need to check input and output times, not processing itself.


Erlang seems to be the language that the big guns use for stuff like this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜