Are operations on container atomic operation?

Developers
Gier
2007-01-29
2013-05-13
  • Gier

    Gier - 2007-01-29

    HI,Would you do me a favour to tell me whether the operations on a container are atomic operation? For example, when the process is during executing listA.insert(), but one signal is fired. therefore the process is interrupted to execute signal function, and this signal handle function has nothing to do with listA.
    My questions is:
    1)During listA.insert(), could  the process be interrupted by a signal? If so, how to prevent memory leaking?

    Thanks!

     
    • Petr Ovtchenkov

      Petr Ovtchenkov - 2007-01-29

      > Would you do me a favour to tell me whether the operations on a container are atomic operation?

      It not atomic. And never will. See here: http://www.sgi.com/tech/stl/thread_safety.html

      > 1)During listA.insert(), could the process be interrupted by a signal?

      Yes, process may be interrupted here.

      > If so, how to prevent memory leaking?

      I don't understand what you mean here.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks