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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is the TinyXml thread safe?
I'm curious about this as well. All of my projects are multithreaded, and using thread-safe libraries.
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
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.