[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Reusing XT instances

Subject: RE: Reusing XT instances
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 31 Jan 2000 17:12:10 -0000
RE: Reusing XT instances
> This much, I could take care of by locking the processor to 
> ensure sequential access.

It's generally much better to create two instances than to create one
instance and lock it. You should only synchronize on a single object where
the state of the object actually needs to be shared between clients.
> 
> SAX says that a parser is reusable but not reentrant. To me, 
> this means that a SAX parser is not thread-safe, so in any 
> multi-threaded environment, you'd have to lock the parser.

With SAX it's not just multi-threading that's an issue, but multiple
activations within a thread. Specifically, you're not allowed to call
parse() from within a call-back. Again, it's crazy to lock the parser, much
better to create a new instance for each parse.
> 
> It's an interesting point that you brought up, however. It 
> could be worthwile to cache the Sheet. It'd make for a lot of rigamarole,
but it might be
> worth considering.
> 
If you take a look at how Saxon does it in SaxonServlet, you'll see that
it's not a lot of rigmarole at all, it's a dozen lines of code.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.