stl vector

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QWxleA==?=

    #1

    stl vector

    Hi all,

    I am devloping an application in VC++ with Visual Studio 2005. In this
    applicatin, Threadpool and stl classes are there. All threads will
    use(sending by pointer to vector) stl vector simultaneously for reading and
    writing purpose. Sometimes, application getting crash. I think, vectors are
    threadsafe. It is getting crash at vector iterators. I checked in call stack
    also. How to avoid this problem without synchronization ?

    --
    Thanks & Regards,
    Alex.
  • Cholo Lennon

    #2
    Re: stl vector

    You have to synchronize. Reading and writting from different threads is not
    thread safe in STL

    --
    Cholo Lennon
    Bs.As.
    ARG


    "Alex" <Alex@discussio ns.microsoft.co mwrote in message
    news:D5941A95-0FEE-4A42-897F-7B3FB74B3576@mi crosoft.com...
    Hi all,
    >
    I am devloping an application in VC++ with Visual Studio 2005. In this
    applicatin, Threadpool and stl classes are there. All threads will
    use(sending by pointer to vector) stl vector simultaneously for reading and
    writing purpose. Sometimes, application getting crash. I think, vectors are
    threadsafe. It is getting crash at vector iterators. I checked in call stack
    also. How to avoid this problem without synchronization ?
    >
    --
    Thanks & Regards,
    Alex.

    Comment

    Working...