Search code examples
vtd-xml

Is VTD-XML thread safe? (Java version)


Because if it thread safe I can use just one instance of VTDGen for the entire application.

Right now I am instantiating a new VTDGen for every requests, I am thinking of making it static so that it is initialized just once.


Solution

  • What do you mean exactly by thread safe? After VTDGen processes one document, and you get vtdNav from it, VTDGen can certainly be reused to process the next document. So in tht sense, it is thread safe, not just in Java, but in C and C++ as well..