Boost logo

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,

Hi Olivier,

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, kalb at, bjorn.karlsson at, gregod at, wekempf at