Boost logo

Boost Users :

Subject: [Boost-users] fast_pool_allocator question
From: steviekm3 (steveclayton.k_at_[hidden])
Date: 2011-06-14 07:17:38


I was wondering if fast_pool_allocator will speed something up.

I have a funtion say g which looks like:

void g( Params p )
{
    std::map<double,Foo> m;
    for( int i = 0; i < 100000; ++it )
    {
         m.insert( ... )
    }
}

g gets called from about 100 different threads running on 16 processor
machine. All the processors are not being used near full capacity. I did
some analysis and find that most of the time one thread is in malloc system
call and other threads are blocking on it. ( I guess malloc only allows
serial access a certain points ).

Would a fast_pool_allocator speed this up. Could I pre-allocate the memory
needed using a fast_pool_allocator ? I don't want the pool to return
memory to the system. Just to reuse memory that is no longer needed ( reuse
memory that m has used after m goes out of scope ).

--
View this message in context: http://boost.2283326.n4.nabble.com/fast-pool-allocator-question-tp3596247p3596247.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net