[Expat-discuss] Multi-Threading in Expat

rolf at pointsman.de rolf at pointsman.de
Thu Mar 25 09:17:34 EST 2004



On 25 Mar, Karl Waclawek wrote:
> Expat is not thread safe.
> As long as you use one parser instance per thread, you are OK.

Err... Let us get this straight, to avoid confusion. One could also
have several parser instances in one thread (or even non-MT
application) in use 'at the same time' in the sense, that every of
this parser instance is somewhere in the middle of parsing input and
awaiting the next chunk of data (all in a status after an e.g. 
XML_Parse(parser, buf, len, 0) call) and they work without confusing
each other.

It's only
> if you want to make call-backs into different threads from
> one parser instance, you have to take care of synchronization
> issues yourself.

Right?

rolf





More information about the Expat-discuss mailing list