On a Linux system, I have one piece of memory of 7 MB fixed size (no growth), the contents of which I update in a real-time application.
I need to write this piece of memory to disk (the same file) once per second.
Considering modern (at the end of 2011) processors and hard drives, what is the most efficient way to implement this functionality? I don't care if the recording actually takes some time, but since this is a real-time application, I need to return to the current application as soon as possible.
What methodologies should I try?
My baseline is standard base fopen (), binary loop fwrite (), fclose ().
I read that mmap () can be useful. Maybe asynchronous I / O? Are there other methodologies that I have to carry out for comparison? From the top of your head, which methodology do you think will be the fastest?
kfmfe04
source share