Is STL string can be used in multithreading application ?
-
HI, I want to write c++ String Functions using STL string class on Linux OS. Is this string class error free ? I read some where these below lines. " The Standard Template Library (STL) that is included with Microsoft Visual C++ 6.0 is not safe for multi-threaded applications." http://support.microsoft.com/kb/813810[^] is it Safe in Linux multi threaded applications ? Thanks, Rayalu.
-
HI, I want to write c++ String Functions using STL string class on Linux OS. Is this string class error free ? I read some where these below lines. " The Standard Template Library (STL) that is included with Microsoft Visual C++ 6.0 is not safe for multi-threaded applications." http://support.microsoft.com/kb/813810[^] is it Safe in Linux multi threaded applications ? Thanks, Rayalu.
STL collections are not thread-safe. You can synchronize them with a mutex when you are accessing them from more than one thread.
-- Si dos montan un caballo, uno debe ir detrás.
-
STL collections are not thread-safe. You can synchronize them with a mutex when you are accessing them from more than one thread.
-- Si dos montan un caballo, uno debe ir detrás.
Thank you.
-
HI, I want to write c++ String Functions using STL string class on Linux OS. Is this string class error free ? I read some where these below lines. " The Standard Template Library (STL) that is included with Microsoft Visual C++ 6.0 is not safe for multi-threaded applications." http://support.microsoft.com/kb/813810[^] is it Safe in Linux multi threaded applications ? Thanks, Rayalu.
Member 6775743 wrote:
The Standard Template Library (STL) that is included with Microsoft Visual C++ 6.0 is not safe for multi-threaded applications
That means the library that comes with MSVC 6.0 was not to safe to use in multi-threaded applications even if the containers were not shared among threads. If you use a more recent version of MSVC (or even MSVC 6 with STLPort), that should not be a problem. Of course, you should still need to synchronize access to container objects that are shared between threads.