Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Does VTD-XML C version support multi-thread?

Help
Jack Hoo
2010-08-26
2013-05-15
  • Jack Hoo
    Jack Hoo
    2010-08-26

    Does VTD-XML C version support multi-threads? if no, any plan on it?

     
  • jimmy zhang
    jimmy zhang
    2010-08-28

    Can you be more specific on what you mean by multithreads?

     
  • Jack Hoo
    Jack Hoo
    2010-08-30

    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. 

     
  • jimmy zhang
    jimmy zhang
    2010-08-30

    will investigate and get back

     
  • jimmy zhang
    jimmy zhang
    2010-09-05

    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

     
  • Jack Hoo
    Jack Hoo
    2010-09-06

    Thanks! I will have a try.

     
  • jimmy zhang
    jimmy zhang
    2010-09-07

    use thread local storage is the easiest way to make it thread safe, …. will issue a patch soon…

     
  • Jack Hoo
    Jack Hoo
    2010-09-09

    Ok, thanks!