Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Thread-safe STL-compatible Wrapper Container

Reply
Thread Tools

Thread-safe STL-compatible Wrapper Container

 
 
Nordlöw
Guest
Posts: n/a
 
      04-16-2008
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
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      04-16-2008
On Apr 16, 2:46 pm, Nordlöw <(E-Mail Removed)> 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:(E-Mail Removed)
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
 
Reply With Quote
 
 
 
 
Marcel Müller
Guest
Posts: n/a
 
      04-16-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
container inside container in stl wolverine C++ 2 07-24-2006 03:08 PM
Copy elements from one STL container to another STL container Marko.Cain.23@gmail.com C++ 4 02-16-2006 05:03 PM
std::transform container => std::abs(container) Steven T. Hatton C++ 4 12-05-2004 07:10 AM
STL: container's values setup by another container Maitre Bart C++ 2 02-11-2004 12:11 AM
std::container::iterator vs std::container::pointer Vivi Orunitia C++ 11 02-04-2004 08:09 AM



Advertisments