Zitat von strasser@uni-bremen.de:
Zitat von Frank Meerkoetter
: as is expected. you might want to look into using thread specific pools, that only synchronize when a new pool block is allocated.
could you please elaborate a bit on this? How would i do this with the std::allocator implemenation provided by Boost.Pool?
the basic idea is to have an object pool for each thread, so that only when the pool runs out of memory std::new is called and a mutex lock is required. thread-local allocations can run concurrently.
you could use boost.pool for this, if none of your threads ever deallocate an object that was allocated by another thread (and thus be part of another pool). you`d have to write your own allocator I think. but boost.pool isn't suitable as a general purpose allocator anyway, because of O(n) free().
Thanks for your explanation. The property that objects that are allocated in one thread must never be deallocated by a different thread is a show stopper for me. My current system is designed as a pipeline. KR, Frank