[xsd-users] CodeSythesis XSD - CXX Tree Multithreading issue

Boris Kolpackov boris at codesynthesis.com
Mon Mar 5 09:24:21 EST 2012


Hi Tom,

tomislav.reichenbach at valida.at <tomislav.reichenbach at valida.at> writes:

> Introducing a mutex before serialization prevents errors, but I have an 
> usage question, is this supposed to be so ?
> To me this FAQ part is unclear :
> 
> [...]
> 
> Per thread the order of executions is as follows:
> 
> string calculate(string input_xml) {
>         input xml->istringstream->create input objects
>         --- do some suff with objects ---
>         output object->serialize-> output xml
>         return output_xml
> }
>  
> There are no shared (global, static or singleton) objects in the calculate 
> function. 

This should work without the mutex serializing calculate() executions.

A few points to confirm/verify:

1. You said you are calling Xerces-C++ Initialize()/Terminate(). Do you
   also pass dont_initialize flag to the XSD parsing and serialization
   functions?

2. Are you using the latest version of Xerces-C++ (3.1.1)? Is it a default
   build (i.e., using default transcoder, etc)?

3. How do you see that the XML is incomplete? Do you write it to a file?
   Is it possible that not all the data has been flushed yet? Can you
   confirm that the object model is complete (i.e., that it is parsed
   correctly and the problem is in serialization)?

Boris



More information about the xsd-users mailing list