
Hi, I have gone through the object pool documentation, but could not find a clear answer to my doubt. I want to make a pool of 10 objects. As and when an object need to be created, the pool will be searched for free objects, then the free ones will be chosen. Otherwise it will wait until any of the object is free. Is this possible with object pool? My questions are... How can I allocate 10 objects in single shot? How can I get the reference to unused object from the pool? Is there a same mechanism for threads as well? Thanks in advance, Lloyd

I have gone through the object pool documentation, but could not find a clear answer to my doubt.
I want to make a pool of 10 objects. As and when an object need to be created, the pool will be searched for free objects, then the free ones will be chosen. Otherwise it will wait until any of the object is free. Is this possible with object pool?
No, the object_pool is just a type-safe interface for the memory pool, which merely allows you to improve performance when you need to allocate a lot of equally-sized chunks and then to free them all.
participants (2)
-
Igor R
-
Lloyd