Thread-safe STL-compatible Wrapper Container

Discussion in 'C++' started by Nordlöw, Apr 16, 2008.

  1. Nordlöw

    Nordlöw Guest

    Does the Boost C++ Libraries (www.boost.org) or any other library
    offer a generalized STL-compatible container wrapper for making any
    other STL-container thread-safe, typically by surrounding all member
    functions with scoped_lock() and scoped_unlock().

    /Nordlöw
     
    Nordlöw, Apr 16, 2008
    #1
    1. Advertising

  2. Nordlöw

    James Kanze Guest

    On Apr 16, 2:46 pm, Nordlöw <> wrote:
    > Does the Boost C++ Libraries (www.boost.org) or any other
    > library offer a generalized STL-compatible container wrapper
    > for making any other STL-container thread-safe, typically by
    > surrounding all member functions with scoped_lock() and
    > scoped_unlock().


    Why would anyone bother? It would be totally useless.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Apr 16, 2008
    #2
    1. Advertising

  3. Nordlöw schrieb:
    > Does the Boost C++ Libraries (www.boost.org) or any other library
    > offer a generalized STL-compatible container wrapper for making any
    > other STL-container thread-safe, typically by surrounding all member
    > functions with scoped_lock() and scoped_unlock().


    The concept of locking function calls will never make an iteration
    thread-safe in a way that the result is well defined. Iterating over a
    changing collection is intrinsically thread-unsafe.


    Marcel
     
    Marcel Müller, Apr 16, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    830
    Daniel T.
    Feb 16, 2006
  2. Gabriel Rossetti
    Replies:
    0
    Views:
    1,394
    Gabriel Rossetti
    Aug 29, 2008
  3. John Nagle
    Replies:
    5
    Views:
    509
    John Nagle
    Mar 12, 2012
  4. Juha Nieminen
    Replies:
    0
    Views:
    411
    Juha Nieminen
    Aug 7, 2012
  5. Luca Risolia
    Replies:
    12
    Views:
    682
    Luca Risolia
    Aug 11, 2012
Loading...

Share This Page