Boost Users :
Subject: Re: [Boost-users] multi_index reserve but allocate
From: Joaquin M LÃ³pez MuÃ±oz (joaquinlopezmunoz_at_[hidden])
Date: 2019-03-20 10:18:02
El 20/03/2019 a las 9:15, Olivier Tristan via Boost-users escribiÃ³:
> Hi Joaquin,
Please don't top-post:
> My goal is not to be fast but to avoid allocation as I am in a high
> priority thread and I want
> to avoid possible allocation lock.
> I tried the allocator [...] using something like that
> Â boost::pool_allocator<
> Â ActiveNote, boost::default_user_allocator_new_delete,
> Â boost::details::pool::default_mutex, 256U, 0U>>;
> My issue with this solution is that the pool is actually shared across
> all object
> using a boost::pool_allocator that requires a mutex as there are
> multiple thread in my app.
Maybe you can give this allocator a try:
It works with Boost.MultiIndex and does not use any mutex at all
(because it's stateful and
as such instances are owned by the containers using them).
JoaquÃn M LÃ³pez MuÃ±oz
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