Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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!

     
    • > 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.