Re: Async writing to lots of files at the same time ?
Re: Async writing to lots of files at the same time ?
- Subject: Re: Async writing to lots of files at the same time ?
- From: Doug Wyatt <email@hidden>
- Date: Mon, 5 Dec 2005 15:32:52 -0800
On Dec 5, 2005, at 3:00 PM, Mark Gilbert wrote:
Folks.
I need to continuously write data into 128 open files at the same
time.
Currently I write one after the other, but I wonder if its worth
putting in code to make each write Asynchronous.
Last I knew (this was quite some time ago) synchronous I/O on a
separate thread was preferable to async. If you think about it in
terms of numbers of kernel transitions per read, it makes sense.
Currently the storage aspect is pulling my app down, and so I want
to 'smoothen' out the impact disk writing has on the overall
operation of my app.
Is Async disk writing a good idea ? Some people have suggested
putting the disk writes into another thread (currently on my main
thread). I am keen to avoid it impacting on my Core Audio IO Proc
which is running on another thread, and can sometimes be pulled
down by the disk access.
Well, whatever effect disk I/O is having on your audio I/O proc, it
doesn't matter whether you're doing the disk I/O on the main thread
or another one.
How would the system deal with 128 async writes. Is this likely to
cause problems, or make things better ?
I would make absolutely sure that your file write offsets, write
buffers, and write buffer sizes are all page-aligned (multiples of
4096). fs_usage is a good way to verify this. If any of those 3 are
unaligned, you end up in non-optimal code paths that are likely to
add extra memory copying steps.
Also be sure that you have set the bit to bypass the cache.
If you've done all this, and still need more performance, then you're
in the realm of experimenting with different sizes of writes and (not
for the faint of heart), reordering writes to minimize seek times.
Doug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden