[Expat-discuss] is expat a reentrant parser

Greg Stein gstein@lyra.org
Wed, 8 Aug 2001 12:31:50 -0700


By that definition, Expat is not "reentrant". It allocates memory.

However, as Fred points out: it *is* thread-safe if you use different
parsers in each thread. (one parser across multiple threads will hork)

Cheers,
-g

On Wed, Aug 08, 2001 at 10:29:56AM -0600, Josh Martin wrote:
> Mike,
> 
>   The first sentace is paraphrased from the HP-UX Release 11.00 man page for 
> sigaction(2). The rest is distilled from my learning about and use of reentrant 
> functions. Anyone is of course free to quote or paraphrase "my" definition if it 
> is useful to them. I also apologize for the odd formatting of the definition, 
> web form email entry was never my forte.
>   
>   - Josh Martin
> 
> 
> > From: MIke Wilson <mike.wilson@tradeweb.com>
> > To: Josh Martin <josh.martin@abq.sc.philips.com>
> > Subject: RE: [Expat-discuss] is expat a reentrant parser
> > Date: Fri, 3 Aug 2001 13:27:09 -0400 
> > MIME-Version: 1.0
> > 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > 
> > Josh,
> > 
> > I just saw this post.  Where did you get this definition?  It's
> > wonderful!  I'd love to be able to cite it from various points in my
> > own project documentation.
> > 
> > TIA,
> > 
> > - - Mike
> > 
> > - -----Original Message-----
> > From:	Josh Martin [SMTP:josh.martin@abq.sc.philips.com]
> > Sent:	Friday, August 03, 2001 12:49 PM
> > To:	SheelR@aol.com; expat-discuss@lists.sourceforge.net
> > Subject:	RE: [Expat-discuss] is expat a reentrant parser
> > 
> > This message was sent from Geocrawler.com by "Josh Martin"
> > <josh.martin@abq.sc.philips.com>
> > 
> > 
> > >>SheelR@aol.com writes:
> > >>         Is expat reentrant?
> > >
> > >  I'm not entirely sure what you mean here.  If
> > you create several
> > >parsers, you should be able to use them at the
> > same time (from
> > >different threads or whatever).  You probably
> > don't want to muck
> > >around with a parser while it is actively
> > parsing, aside from calling
> > >the defined APIs to add/change callbacks.
> > >
> > 
> > <snip>
> > 
> > >  -Fred
> > >
> > >-- 
> > >Fred L. Drake, Jr.  <fdrake at acm.org>
> > >PythonLabs at Zope Corporation
> > 
> > Reentrant Functions:
> > 
> >   Reentrant functions (and functions which are not
> > interruptable
> > by signals) are defined as functions that may be
> > invoked, without
> > restriction, from signal-catching functions. A
> > function is reentrant
> > only if, when invoked inside a signal-catching
> > function, it does
> > not adversly affect the normal flow of operations
> > of the function
> > or code that the signal-catching function
> > interrupted. In other
> > words, reentrant functions aren't going to
> > unexpectedly change
> > any critical values, and thus the result of the
> > operations, if they
> > are invoked in the middle of a function.
> > 
> >   I'm not positive that this is the meaning that
> > SheelR was going
> > for, but this is the "standard" meaning of a
> > reentrant function.
> > Personally, I would like to know the answer to
> > this question,
> > given this definition of reentrant.
> > 
> >  - Josh Martin
> > 
> > _______________________________________________
> > Expat-discuss mailing list
> > Expat-discuss@lists.sourceforge.net
> > http://lists.sourceforge.net/lists/listinfo/expat-discuss
> > 		
> > 
> > Geocrawler.com - The Knowledge Archive
> > 
> > 
> > _______________________________________________
> > Expat-discuss mailing list
> > Expat-discuss@lists.sourceforge.net
> > http://lists.sourceforge.net/lists/listinfo/expat-discuss
> > 
> > -----BEGIN PGP SIGNATURE-----
> > Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
> > 
> > iQA/AwUBO2rf9owiya8i+ZOTEQLdlwCdF4RwCoa/phPg0Amuz34H3x2+G6YAnAsK
> > qesUwwwrwKd1FNVuKsafDp/w
> > =Nwae
> > -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/expat-discuss

-- 
Greg Stein, http://www.lyra.org/