I am trying to use the VTD-XML in a multi-thread program: One thread receives the incoming xml and parses the xml to VTD-XML, the other threads do some xpath evaluation using selectXPath with the VTD-XML generated in the first thread.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does VTD-XML C version support multi-threads? if no, any plan on it?
Can you be more specific on what you mean by multithreads?
I am trying to use the VTD-XML in a multi-thread program: One thread receives the incoming xml and parses the xml to VTD-XML, the other threads do some xpath evaluation using selectXPath with the VTD-XML generated in the first thread.
will investigate and get back
Can you use thead local variable on a few global/static variables?
these variables are nsList *nl and exprList *el in xpath.h, and struct exception_context the_exception_context;?
here is the reference to thread local storage
http://en.wikipedia.org/wiki/Thread-local_storage
Thanks! I will have a try.
use thread local storage is the easiest way to make it thread safe, …. will issue a patch soon…
Can you go to the following URL and down the thread safe version of vtd-xml?
http://vtd-xml.cvs.sourceforge.net/viewvc/vtd-xml/ximple-dev_c/vtd-xml_ts/
it is still experiemental, but is actually quite stable…
Ok, thanks!