Questions tagged [buffer]

A buffer is an area of memory set aside for temporary storage of data while it is being moved from one place to another. This is typically done to speed up processes with significant latency, such as writing to a disk, printer or other physical device. The output is ready to be sent to the device before the device is ready to accept it, so it is moved to the buffer so that the sending program does not have to continue waiting.

A may be used when moving data between processes within a computer. This is comparable to buffers in telecommunication. Buffers can be implemented in a fixed memory location in hardware—or by using a virtual data buffer in software, pointing at a location in the physical memory. In all cases, the data stored in a data buffer are stored on a physical storage medium. A majority of buffers are implemented in software, which typically use the faster RAM to store temporary data, due to the much faster access time compared with hard disk drives. Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler or in online video streaming.


References

7035 questions
18
votes
3 answers

Set pipe buffer size

I have a C++ multithreaded application which uses posix pipes in order to perform inter thread communications efficiently (so I don't have to get crazy with deadlocks). I've set the write operation non-blocking, so the writer will get an error if…
Zeruel
  • 183
  • 1
  • 1
  • 5
18
votes
3 answers

Insufficient memory in Windows command line

I created a batch file which copies a directory with xcopy for backup reasons. Then I use pkzip in order to zip the backup folder (and email it through a batch file which is working), but I am getting an error message for insufficient memory. I…
Panos Raul
  • 191
  • 1
  • 1
  • 6
18
votes
1 answer

What does "CRT detected that the application wrote to memory after end of heap buffer" mean?

I am having trouble with this code. It breaks at the free(q->izv) function and i get a debug error saying: CRT detected that the application wrote to memory after end of heap buffer I have no idea what that means so i would be grateful for any help…
user3699827
  • 183
  • 1
  • 1
  • 5
18
votes
2 answers

How do I unpack various form of integers in a byte buffer in Golang?

I need to extract various fields in a byte buffer. I came up with this solution: func (fs *FileSystem) readSB() { // fs.f is a *os.File buf := make([]byte, 1024) fs.f.ReadAt(buf, 1024) // Offset: type var p *bytes.Buffer //…
knarf
  • 2,672
  • 3
  • 26
  • 31
17
votes
4 answers

How to tell GDB to flush the stdio of the program being debugged

The stdio is usually buffered. When I hit a breakpoint and there's a printf before the breakpoint, the printed string may still be in the buffer and I can not see it. I know I can flush the stdio by adding some flush code in the program. Without…
Yorkwar
  • 1,204
  • 1
  • 11
  • 27
17
votes
6 answers

How to make a shortcut for moving between Vim windows?

Let’s say I have single Vim tab displaying 9 buffers (equally separated, like a 3×3 table). Currently, to get from the top left window to the bottom right one, I have to press 3, Ctrl+W, J, and then 3, Ctrl+W, L. This is cumbersome, and I would like…
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
17
votes
2 answers

OpenGL VBO updating data

I have to draw a buffer that holds a couple thousand vertices. I am using a vbo to store the data. I know I will have to update the VBO many times - but only in small parts at a time. So I am wondering what the best method to doing so is: Split VBO…
Pubby
  • 51,882
  • 13
  • 139
  • 180
17
votes
4 answers

How to merge a *Single Image* with a video

I am trying to combine a single video with a single image. This is not trying to combine many images into a single video such as create movie from [UIImage], Swift How do I export UIImage array as a movie? Make movie file with picture Array and…
impression7vx
  • 1,728
  • 1
  • 20
  • 50
17
votes
5 answers

MemoryStream.Read doesn't copy bytes to buffer - c#

I don't really get it and it's driving me nuts. i've these 4 lines: Image img = Image.FromFile("F:\\Pulpit\\soa.bmp"); MemoryStream imageStream = new MemoryStream(); img.Save(imageStream, ImageFormat.Bmp); byte[] contentBuffer = new…
agnieszka
  • 14,897
  • 30
  • 95
  • 113
17
votes
1 answer

docker logs and buffered output

I want to continously print dots without newline (waiting behavior). This bash one-liner works fine on my machine: $ while true; do sleep 1; printf '.'; done .......^C However, when I run it in a Docker container, and when I try to read its output…
Elouan Keryell-Even
  • 990
  • 1
  • 14
  • 36
17
votes
1 answer

C# TcpClient, read and write stream simultaneously

I know this kinda question got asked several times already here on SO, but not a single thread addressed that exact same problem which we are facing at the moment. We're basically working on a TCP Server/Client Application, where the Server is…
Psylution
  • 183
  • 1
  • 5
17
votes
1 answer

deque in python pandas

I am using Python's deque() to implement a simple circular buffer: from collections import deque import numpy as np test_sequence = np.array(range(100)*2).reshape(100,2) mybuffer = deque(np.zeros(20).reshape((10, 2))) for i in test_sequence: …
Fra
  • 4,918
  • 7
  • 33
  • 50
17
votes
2 answers

Difference between JspWriter and PrintWriter in Java EE?

For all you "duplicate" fanatics, there is a similar question on SO right here. The difference is that I paint a vivid example that I can not understand the output of. The documentation for JspWriter and PrintWriter says there are two differences:…
Martin Andersson
  • 18,072
  • 9
  • 87
  • 115
17
votes
1 answer

Vim tabs and buffers

I've started using Vim some time ago. So far - I enjoyed my experience with this editor. Until recently I started using Tabs in Vim. I must admit that I am a bit frustrated about whole buffer/tab/window concept in Vim. For example, suppose I am…
Benji
16
votes
3 answers

vim — How can I search buffers?

I am looking for some command like: :b1!g/something_here/ where I supposedly search for a word "something_here" in the buffer "b1". How can I do it?
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697