I have a time-sensitive C program that performs serial port I/O with microsecond-level precision. The program currently works well and meets our requirements. I have two questions:
- Would there be any significant advantages to rewriting this program in Rust, particularly in terms of performance or reliability for such precise timing operations?
- Currently, the program writes the data it reads from the serial port to an ASCII file. A separate Qt application launches this C program and displays the current file size. We now need to modify the system so that the Qt application can also display the contents of the data being read at 1 or 2 seconds periodicity. What would be the most efficient way to implement this inter-process communication between the C program and the Qt application?
Additional context:
- The target OS is Yocto Linux
- The C program is responsible for data acquisition from the serial port.
- The timing requirements are very strict (microsecond level). This means,
- The program needs to send commands and read responses at very specific, short intervals (measured in millionths of a second).
- It uses high-precision timing functions to measure and control these intervals.
- The code tries to maintain consistent timing between operations, adjusting for any delays.
- It uses real-time scheduling to ensure the program gets immediate CPU attention when needed.
- The system needs to remain responsive and efficient.
I'd appreciate insights on both the potential benefits of a Rust rewrite and recommendations for implementing the new IPC requirement with Qt. Thanks in advance!