As the attached design, multi thread(reentrance) will be started to do data transfer on server.
Some threads need to open a buffer inside and accumulate the data, and write data to DB with time interval
Some threads not need.
Others parts have all been done, only this buffer, If I initialize the buffer in all the thread, but some buffer not need do so, then the memory is wasted.
So how to define this buffer efficiently.
Any suggestion, thanks.