<em****************@gmail.comwrote in message
news:11*********************@j4g2000prf.googlegrou ps.com...
Hello,
I am a C/C++ newbie and I have a simple question concerning fast data
writing to binary files. Are there any other faster methods than the
standard write() method to write to binary data files? I ask this
question because I have to store a big amount of data coming from an
PCI A/D card with a sampling frequency of 20 MB/s. Now I have to
implement some additional computations and would need to speed up the
data transfer. I am using a Windows XP computer and GCC 3.4.3 and
Borland 5.5 respectively. Are there any special free libraries for
this purpose?
Thank you very much
Well, the delay will come in to the physcial read and writes with moving the
heads, etc... If you buffer the writes then you shouldnt' get that delay.
This will especially work if you can load the entire data to write in
memory, although it doesn't sound like you can do that with 20MB/second.
Another alternative is to use threads. Send a write request to a thread
safe que that another thread reads to write the data, then your main thread
shouldn't have to wait for the file i/o to complete. This will probably work
as long as the writing thread can keep up with writing 20MB/second. I
really don't know how fast HDs are nowadays with MB/second but 20 should be
fine.
You might want to discuss this in comp.programming.threads