Low latency serial communication on Linux

后端 未结 7 2045
清歌不尽
清歌不尽 2020-12-13 07:46

I\'m implementing a protocol over serial ports on Linux. The protocol is based on a request answer scheme so the throughput is limited by the time it takes to send a packet

相关标签:
7条回答
  • 2020-12-13 08:47

    None of those system calls have an effect on latency. If you want to read and write one byte as fast as possible from userspace, you really aren't going to do better than a simple read()/write() pair. Try replacing the serial stream with a socket from another userspace process and see if the latencies improve. If they don't, then your problems are CPU speed and hardware limitations.

    Are you sure your hardware can do this at all? It's not uncommon to find UARTs with a buffer design that introduces many bytes worth of latency.

    0 讨论(0)
提交回复
热议问题