Is it STL thread-safe?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cai

    Is it STL thread-safe?

    Hi, I wonder if STL is thread-safe or how can I feel safe if I share a STL
    container in mutiple threads.
    I use VC++6.0.
    Thank you!


  • Russell Hanneken

    #2
    Re: Is it STL thread-safe?

    "cai" <aladdin_sh@asu s.com.cn> wrote in message
    news:be40us$vai 3$1@ID-147672.news.dfn cis.de...[color=blue]
    > Hi, I wonder if STL is thread-safe or how can I feel safe if I share a STL
    > container in mutiple threads.
    > I use VC++6.0.[/color]

    You're not the first person to ask:



    --
    Russell Hanneken
    rhanneken@pobox .com


    Comment

    • Dhruv

      #3
      Re: Is it STL thread-safe?

      On Fri, 04 Jul 2003 08:03:07 -0700, Russell Hanneken wrote:

      [snip]......
      [color=blue]
      > You're not the first person to ask:
      >
      > http://tinyurl.com/g18o[/color]

      I'd like to know what exactly you mean what you say that something is
      thread safe. Until now, I was thinking that it meant that it can be used
      across threads without the fear of reading a value being modified, or
      simultaneously writing to the same variable/resource. But, does it mean
      that the code is amenable to mutex protection, as in if you put a mutex
      around that piece of code, then it will work with multiple threads?

      Regards,
      -Dhruv.







      Comment

      • Alexander Terekhov

        #4
        Re: Is it STL thread-safe?


        Dhruv wrote:[color=blue]
        >
        > On Fri, 04 Jul 2003 08:03:07 -0700, Russell Hanneken wrote:
        >
        > [snip]......
        >[color=green]
        > > You're not the first person to ask:
        > >
        > > http://tinyurl.com/g18o[/color]
        >
        > I'd like to know what exactly you mean what you say that something is
        > thread safe.[/color]




        regards,
        alexander.

        Comment

        Working...