Questions tagged [buffers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
116 views

Implementing a method to achieve faster image acquisition

I hope I can explain my question clearly. I'm planning to do some real time 2D grayscale image acquisition, and after reading some articles, I noticed that many are using buffers or multithreading or ...
user avatar
  • 129
0 votes
0 answers
224 views

How to implement a debounce buffer system on AWS?

I'll describe my case: I have an aws lambda that will expose an API interface that will return json data (by topic) which is cached. This lambda will also offer private endpoints to recalculate the ...
user avatar
  • 493
-4 votes
1 answer
280 views

Better way to process huge files

I have a huge csv file and I have to process that file and do some data manipulation. Right now I'm reading/loading the file in buffer and then doing the data processing work. I find this approach ...
user avatar
0 votes
1 answer
459 views

buffering messages and send after reconnect

I'm looking for a solution for this, buffering messages in an array and send them after web-socket reconnect. I can check the socket client and push messages to an array when connection is lost and ...
user avatar
2 votes
2 answers
257 views

Why are prints to standard output buffered?

I'm trying to understand what is the motivation for buffering the print to standard output. I've experienced this in multiple programming languages, a scenario where you're trying to trace a bug by ...
user avatar
1 vote
1 answer
165 views

Ring buffers for data with unknown maximum size

I see ring buffers are very useful with their speed and if you have a known maximum buffer length they make a lot of sense. Let's say in the scenario where you have streaming data, but the playing ...
user avatar
2 votes
1 answer
614 views

Multithreading with triple buffer, do I have to do the waiting for the condition variable?

I have a triple buffer implementation that is often used in threads in such a way that when new data is expected, there's always a WaitData(n) function called on the buffer (A condition variable's ...
user avatar
  • 147
8 votes
1 answer
714 views

What type of buffer should I implement for a one-way streaming audio device?

I'm working on a project where audio data is streamed to a device. The audio data is encoded via opus and streamed at 20 ms payloads at a time. The streaming is done via TCP to avoid packet loss ...
user avatar
-2 votes
1 answer
168 views

how integer type can handle text stream (getchar()) in C? [closed]

While going through C programming by Ritchie and kernighan, I came across the following code. #include<stdio.h> int main() { int t; t = getchar(); while ((t=getchar()) != EOF) { ...
user avatar
  • 99
0 votes
2 answers
1k views

Which 'InputStream' subtype is used by 'Socket' type object here?

In the below server socket program, byte stream object is used to read data from client, as mentioned - InputStream in = socket.getInputStream(); public class SingleThreadTCPServer{ ...
user avatar
  • 2,225
2 votes
1 answer
979 views

Query on java I/O BufferedOutputStream write() method

Below is the code that is written using byte stream non-buffer class FileInputStream and FileOutputStream with the usage of explicit user buffers. public class FileCopyUserBuffer{ public static ...
user avatar
  • 2,225
0 votes
1 answer
1k views

design for buffering or queuing data streams to replace database

We have a system (ms stack, .net, sql) that receives data from thousands of remote devices (several independent readings/min). We currently save all the data to a db as it arrives and a second service ...
user avatar
  • 153
1 vote
2 answers
6k views

Which is better: for valid buffer length?

This is a basic question. But, I think understanding this would be helpful to play with buffers in 'C'. Thanks. Scenario Just a sample snippet char *test_buff = (char *) malloc(512); //allocate 512 ...
user avatar
  • 11
2 votes
3 answers
251 views

Efficiently "moving" data upward through a communication stack

I have implemented an application protocol stack that moves an incoming stream of data upward through several layers, as follows: copies a TCP segment from an OS buffer to my_buffer. after ...
user avatar
  • 723
7 votes
4 answers
14k views

Is using a bigger buffer useful?

I use buffer for quite a long time when I need to copy a stream or read a file. And every time I set my buffer size to 2048 or 1024, but from my point of view a buffer is like a "bucket" which ...
user avatar
  • 183
23 votes
9 answers
4k views

Why is it so difficult to make C less prone to buffer overflows?

I'm doing a course in college, where one of the labs is to perform buffer overflow exploits on code they give us. This ranges from simple exploits like changing the return address for a function on a ...
user avatar
5 votes
2 answers
1k views

Data Structures: What are some common examples of problems where "buffers" come into action?

I was just wondering if there were some "standard" examples that everyone uses as a basis for explaining the nature of a problem that requires the use of a buffer. What are some well-known problems in ...
user avatar
  • 6,115