Re: I/O class: how to design for special ca
- From: "Simon Elliott" <Simon at ctsn.co.uk>
- Date: 31 Jan 2006 21:48:44 GMT
On 26/01/2006, H. S. Lahman wrote:
> If I was going to use the one-time buffer approach I think I would do
> it within the CFoo implementation. Maybe something like:
[snip]
Thanks for all your discussions of this.
In the end I decided to go for the above. The buffer, with any special
requirements it may have, is owned by the object. The user buffer is
copied in, and therefore can be any length.
If profiling indicates that this is a problem, I can expose the buffer
pointer and size, and the user can fill the buffer and call the method
which outputs the buffer directly.
However, interestingly, the copy-in method seems to perform better in a
heavily loaded system (ie the sound card doesn't under-run) which seems
counter-intuitive to me as it's doing lots of short reads of the sound
file rather than a few longer reads.
--
Simon Elliott http://www.ctsn.co.uk
.
- References:
- I/O class: how to design for special case
- From: Simon Elliott
- Re: I/O class: how to design for special case
- From: H. S. Lahman
- Re: I/O class: how to design for special case
- From: Simon Elliott
- Re: I/O class: how to design for special case
- From: H. S. Lahman
- Re: I/O class: how to design for special case
- From: Simon Elliott
- Re: I/O class: how to design for special ca
- From: H. S. Lahman
- I/O class: how to design for special case
- Prev by Date: Re: aggregate boundries
- Previous by thread: Re: I/O class: how to design for special ca
- Next by thread: Re: I/O class: how to design for special case
- Index(es):
Relevant Pages
|