Re: Network buffering question
- From: "Ed Prochak" <edprochak@xxxxxxxxx>
- Date: 30 Aug 2006 04:40:43 -0700
Scott McPhillips [MVP] wrote:
Alex Fraser wrote:
I disagree with Scott's suggestion of a large circular buffer. It is
wasteful of memory and a long time ago I found it to have marginally lower
performance than a simpler approach, which goes something like this:
Me too:) I suggested a large buffer, not a large circular buffer. What
I use, and what your code also uses, is what I think of as a "slide
down" buffer, where any remaining message fragment must be copied to the
buffer start if it is too close to the end. Making the buffer large
reduces the frequency of this copying.
--
Scott McPhillips [VC++ MVP]
The alternative is double buffering. First call you use buffer A, parse
the messages, leaving the start of message M. Call again with buffer B
and continue processing by reading the last of buffer A (the start of
the next message) and continuing with buffer B.
If you run multiThreaded, then you can send off the request to fill
buffer B as soon as you get back buffer A. Parsing buffer A while B is
off getting more data.
Ed
.
- References:
- Network buffering question
- From: Till Crueger
- Re: Network buffering question
- From: Alex Fraser
- Re: Network buffering question
- From: Scott McPhillips [MVP]
- Network buffering question
- Prev by Date: Re: Fibonacci implementation
- Next by Date: Re: TextBox array in ASP
- Previous by thread: Re: Network buffering question
- Next by thread: Re: Network buffering question
- Index(es):
Relevant Pages
|