Boost logo

Boost :

Subject: Re: [boost] Proposal: Monotonic Containers- Thread specific monotonic allocator
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-21 19:34:18


Hi Vicente,

what do you think about having a monotonic allocator using a thread specific
> storage so this allocator will not need to use a mutex to protect the
> allocation?

This seems like a good idea. How about:

std::list<int, monotonic::allocator<int> > global;
std::list<int, monotonic::shared_allocator<int> > shared_global; // uses
mutex
std::list<int, monotonic::local_allocator<int> > thread_specific_global; //
doesnt use mutex

This is now in the sanbox at
https://svn.boost.org/svn/boost/sandbox/monotonic/boost/monotonic/local_allocator.hpp,
but untested. I am yet to write a test harness for multi-threaded
applications.

> Best,
> Vicente

Thanks for the idea Vicente,

Regards,
Christian

PS. updated benchmark results for GCC and MSVC at http://tinyurl.com/lj6nab


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk