[Expat-discuss] Thread Safety
karl at waclawek.net
Mon Jul 12 23:20:09 CEST 2004
> There is the possibility that two parsers could be allocated or
> destroyed concurrently, although that is not the case I am seeing. I
> have one more theory: Is there a document size limit? I am not
> dealing with a real document per se, but rather data streams which
> carry a lot of XML data which is all parsed by the same parser (I
> achieved this by priming the parser with a fake document outermost
> element before starting to feed it the actual incoming XML). So it
> could conceivably be asked to parse several gigabytes of data (not all
> in the same chunk, of course).
No, data size should not make a difference. Large documents/streams
are rather a strength of Expat.
Btw, all heap data in Expat are stored in the parser instance,
and since each thread has its own stack, there should generally
be no problems as long as the parser instances are different.
If you are running Expat on Windows, what version of the
runtime library are you using in your app? There are single
and multi-threaded versions available in VC++.
More information about the Expat-discuss