Menu

Thread Safe

Developer
Anonymous
2004-07-28
2013-05-20
  • Anonymous

    Anonymous - 2004-07-28

    Is the TinyXml thread safe?

     
    • Caleb Gingles

      Caleb Gingles - 2004-09-26

      I'm curious about this as well. All of my projects are multithreaded, and using thread-safe libraries.

       
    • Lee Thomason

      Lee Thomason - 2004-10-06

      Popular topic. :)

      In general, no, TinyXml is not thread-safe.

      There are 2 scenarios that come to mind:

      1. Using TinyXml across multiple threads, each thread using a different TiXmlDocument.

      This seems safe, but there are static variable in TinyXml. And even if you avoid those, most default STL implementations are not thread safe in the std::string class.

      In theory, this should work in non-STL mode but I've never tried it. Proceed with caution.

      2. Accessing the TiXmlDocument from multiple threads.

      This will crash quickly and hard.

      lee

       
    • egene

      egene - 2004-12-22

      Hmmm . . . I looked through the code, and didn't see any static variables other than those used in a constant manner:

      utf8ByteTable
      errorString
      entity
      condenseWhiteSpace

      What am I missing?

      P.S. My STL is thread safe.

       

Log in to post a comment.

MongoDB Logo MongoDB