By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,677 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,677 IT Pros & Developers. It's quick & easy.

Methods for fast binary file output?

P: n/a
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

Daniel

Jul 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<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
Jul 19 '07 #2

P: n/a
On Thu, 19 Jul 2007 07:45:29 -0700, email.ttindustries wrote:
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?
Do you REALLY need to sample at 20MB/s? Can you lower the sampling rate
to something realistic and still get adequate samples? That would be my
first question.

Jul 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.