We need to develop some kind of buffer management for the application that we are developing using C #.
In fact, the application receives messages from devices as they arrive (maybe a lot in a short period of time). We need to queue them in some kind of buffer pool so that we can process them in a controlled manner.
We thought about allocating a block of memory in 256 byte blocks (all messages are smaller than this), and then, using buffer pool management, have a pool of available buffers that can be used for incoming messages and a buffer pool that is ready for processing.
Thus, the thread will "Get the buffer" (process it), "Free buffer" or "Leave in the pool." We also need to know when the buffer was filling.
Potentially, we also need a way to peer into the buffers to see that the buffer with the highest priority in the pool, and not always get the next buffer.
Is there support for this in .NET, or is there some kind of open source code that we could use?
c # buffer pool
nzpcmad
source share