Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-05-10 17:35:56


----- Mensaje original -----
De: Patel Priyank-PPATEL1 <priyankpatel_at_[hidden]>
Fecha: Miércoles, Mayo 10, 2006 10:49 pm
Asunto: Re: [Boost-users] [multi_index] Core dump in multi-index
library !!

> Hi Joaquin,
[...]
> One other thing, addition and deletionIs done by separate
> threads in my application.

Oh, oh. multi_index_container is *not* thread safe, so
this smells like the problem --and it is not, it certainly
has the potential to crash your app sooner or later.
Please take into account thread unsafety extends to
every member function of multi_index_container, so
you'd better lockguard *every* public method of
Procedure_Pool. Looking fwd to knowing your results.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

In case you're wondering, STL implementations typically
have the same level of thread safety as B.MI provides:

  1. Concurrent access to different containers is safe.
  2. Concurrent read-only access to the same container
     is safe.

The rationale is that locking every public method
of an STL container adds an unavoidable runtime
overhead (you might not need it), and moreover it
doesn't necessarily map to what constitutes *atomicity*
to a given app --in your case, for instance, atomicity,
and thus lockguarding, is best done at the level
of Procedue_Pool interface.


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