Re: Network buffering question



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]

.



Relevant Pages

  • Re: Network buffering question
    ... wasteful of memory and a long time ago I found it to have marginally lower ... Me too:) I suggested a large buffer, ...
    (comp.programming)
  • Re: Discovering variable types...
    ... >- but I suppose MS expect us to use wrappers ... memory allocations for your variables from disk as well. ... >They most certainly are of fixed size, changing the size of a String ... >>me to keep buffer size and current postion right in the memory block. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Discovering variable types...
    ... >memory it points to is on the heap. ... sequentially reading data, if one is randomly reading records, then a ... >project is what's prompting me to improve disk access. ... from a memory buffer I can do it in about a second. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Multicast Directshow Graph Bridging, COW Rustling, & the Use of Portable Holes in Cartoon Ph
    ... memory to share buffer pools across processes and works pretty well. ... You get two basic Direct Show filters, ... issue each GMF-source a virtual memory alias with COW ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: PCI bus-master and large contiguous memory buffers
    ... I built my scatter gather list in SRAM that was on my device, ... could have done it in system memory had I needed to. ... interrupt when a buffer was filled, the application would save the buffer to ... beginning of the recording I made a device IO control call to my driver. ...
    (microsoft.public.development.device.drivers)