You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Vikrant sutar <vi...@yahoo.com> on 2004/09/22 22:03:32 UTC

CatchedXPathAPI - multithreading implementation

Hi All,

I am looking for multithreaded implementation using
CatchedXPathAPI. I read many postings regarding this
and it seems it improves performance rather than using
XPathAPI. 
But after having closer look at API, I could not get
how CatchedXPathAPI will use CatchedXPath unless we do
not change the Node for the parsing. I mean in none of
the CatchedXPath constructor or method we set this
Document mode.

I also hardly got any examples on net.

Can any of us who has implemented this API help. I
appreciate if I can get any implementation.

In short we have small xml documents, which we 
process using XPathAPI and I am looking for ways in
which performance can be improved.

All suggestions are welcome.

Thanks a lot,
Vikrant

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: CatchedXPathAPI - multithreading implementation

Posted by Joseph Kesselman <ke...@us.ibm.com>.



CachedXPathAPI assumes that you are *NOT* going to change the source
document(s) between path searches. If you do so, it's your responsibility
to flush the cache by discarding the CachedXPathAPI object and obtaining a
new one.

(Or you could try the experimental DOM2DTM2 adapter, which attempts to
tolerate mutation of the DOM between calls. But that won't work with all
DOMs and it hasn't been intensively tested or performance-tuned.)

The long-term answer will probably be an XDM cursor layer running over the
DOM back-end, which will avoid the problems of trying to express a DOM
through a DTM and should have the advantages of DOM2DTM2 without (most of)
the disadvantages. But that involves major changes to core Xalan.


As far as multithreading goes: I don't _think_ CachedXPathAPI is reentrant,
but I'm not 100% sure at this point. If you're going to share it across
threads, I'd recommend putting it behind a semaphore so only one thread is
running it at a time.


______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org