I am writing a polled/response communications application and would like a facility to request memory buffers from a pool to hold message blocks. I'm using VB.Net 2005 for the project.

The idea is that on polling a device I would request two buffers from a memory pool, format the first as the poll message for transmit, and format the second to hold the receive message. I'd then queue these on a protocol task queue for the protocol task to process (add the header, FCS, trailer etc and send via the driver). The protocol task would inset the device's response characters in the second buffer as the receive message, strip off the protocol bytes and return the message buffers to the application task. The application task would then process the received message and return the buffers to the memory buffer pool.

Does the .NET framework have any kind of memory buffer pool that I can request buffers from (and return to the pool later)? This was a facility offered in a modified real-time embedded operating system that I worked with back in the 90's and it worked extrmely well. In that system the memory buffers were requested and returned from/to the memory pool via API calls.