Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Is STL string can be used in multithreading application ?

Is STL string can be used in multithreading application ?

Scheduled Pinned Locked Moved C / C++ / MFC
c++comlinuxhelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 6742414
    wrote on last edited by
    #1

    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.

    M N 2 Replies Last reply
    0
    • U User 6742414

      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.

      M Offline
      M Offline
      mav octaval
      wrote on last edited by
      #2

      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.

      U 1 Reply Last reply
      0
      • M mav octaval

        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.

        U Offline
        U Offline
        User 6742414
        wrote on last edited by
        #3

        Thank you.

        1 Reply Last reply
        0
        • U User 6742414

          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.

          N Offline
          N Offline
          Nemanja Trifunovic
          wrote on last edited by
          #4

          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.

          utf8-cpp

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups