Using VTD Xml in Multithreaded App

In an earlier post of mine I had given an example of how to use VTD Xml.We could run into requirements where in we would like to use VTD xml in a multi threaded application.This post provides a working example for integrating VTD xml in a multi threaded application.
The requirement: I have large number of XPATHs that need to be resolved.Due to large number of XPATHS,our application may slow down.So the better way would be to resolve XPATHs in multiple threads.
In the below code an important point that needs to be noted is that after parsing the xml using VTDGen,we store the navigator in a variable by invoking GetNav().The GetNav() call cleans internal state , so we should keep a copy of navigator and pass the “duplicate” of navigator object to each task.

 

Leave a Reply

Your email address will not be published. Required fields are marked *