> Hi Dave,
> Thanks for the information. I am able to download the latest
code
> from CVS. I am looking into ThreadTest.cpp file and found that the
transformation is
> locked. If CompiledStylesheet is threadsafe, transformation don't need to
be locked.
Huh? What do you mean by "the transformation is locked"? The only locking
that's done is to ensure that the counter that figures out when all of the
threads are done is synchronized. This has _nothing_ to do with whether or
not the compiled stylesheet or parsed source instances are thread-safe.
> I was not able to make my application thread safe with xalan1.1.
> That is why I wanted to get the latest code. I have tried with the
Threadsafe sample given with
> xalan1.1.
> Size of my XSL file is about 110KB. Size of my XML file is about 100KB. I
am
> able to share
> parsed StylesheetRoot among multiple threads. But it is failing, for
> multiple concurrent requests.
What do you mean by "multiple concurrent requests"? The ThreadSafe sample
does the following:
Compile a stylesheet in the main thread.
Parse a source document in the main thread.
Start n threads to do transformations.
> It worked if I spawn 5 threads concurrently. But If I spawn like 10 or
more
> threads concurrently it fails
> with following error.
> Assertion failed: m_strings.size() == m_index.size(), file
> PlatformSupport/XalanDOMStringPool.cpp, line 196
You should _never_ be in this code if the source document has been
pre-built. Did you modify the sample in any way? We've tested this one
multiple platforms with thousands of threads and not found any problems.
> I tried locking the transformation and it worked fine. I am doing the
same
> thing given in the
> ThreadSafe sample.
> Please let me know If I need to do something else (like setting some
falgs
> during building the xalan libary)
> to make the application thread safe.
No, there's nothing special that needs to be done. Once you've asked a
XalanTransformer to compile a stylesheet or parse a source document, that
object is safe to share amongst threads. What's not safe is sharing a
XalanTransformer instance amongst threads. Each thread has to have its own
transformer, or you need to serialize access amongst threads, which is not
really the best thing to do.
Dave
"Avula, Raj"
<RAvula@first To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
am.com> cc: (bcc: David N Bertoni/CAM/Lotus)
Subject: RE: How Can I get New Xalan
Source Code(XalanTransformer
06/21/2001 class) .
03:41 PM
Please
respond to
xalan-dev
Hi Dave,
Thanks for the information. I am able to download the latest
code
from CVS.
I am looking into ThreadTest.cpp file and found that the transformation is
locked.
If CompiledStylesheet is threadsafe, transformation don't need to be
locked.
I was not able to make my application thread safe with xalan1.1.
That is why I wanted
to get the latest code. I have tried with the Threadsafe sample given with
xalan1.1.
Size of my XSL file is about 110KB. Size of my XML file is about 100KB. I
am
able to share
parsed StylesheetRoot among multiple threads. But it is failing, for
multiple concurrent requests.
It worked if I spawn 5 threads concurrently. But If I spawn like 10 or more
threads concurrently it fails
with following error.
Assertion failed: m_strings.size() == m_index.size(), file
PlatformSupport/XalanDOMStringPool.cpp, line 196
I tried locking the transformation and it worked fine. I am doing the same
thing given in the
ThreadSafe sample.
Please let me know If I need to do something else (like setting some falgs
during building the xalan libary)
to make the application thread safe.
Thanks,
Raj..
> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, June 21, 2001 8:21 AM
> To: [EMAIL PROTECTED]
> Subject: Re: How Can I get New Xalan Source
Code(XalanTransformer
> class) .
>
>
> The easiest way to get the code is to use CVS with anonymous access. See
> here for more details:
>
> http://xml.apache.org/cvs
>
> > The way I understand XalanTransformer is, it can be used as repository
> of
> > compiled stylesheets. In mutli-threaded scenario, I can have a
> > XalanTransformer class as a static member which will be loaded and
> compiles all the
> > stylesheets when the library is loaded and each thread of execution can
> create seperate
> > XalanTransformer object to do the transformation and destroys it.
> > Please let me know if my understanding is wrong.
>
> That's correct. See the ThreadSafe sample, as well as the ThreadTest
> test,
> for more information.
>
> Dave
>
>
>
>
>
> "Avula, Raj"
>
> <RAvula@first To:
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> am.com> cc: (bcc: David N
> Bertoni/CAM/Lotus)
> Subject: How Can I get New
> Xalan Source Code(XalanTransformer
> 06/20/2001 class).
>
> 08:20 PM
>
> Please
>
> respond to
>
> xalan-dev
>
>
>
>
>
>
>
>
>
> Hi,
> I would like to use new XalanTransformer class which is
> modified
> after 1.1.
> Is it Ok, if I just download new XalanTransformer.cpp,
> XalanTransformer.hpp
> and rebuild the library, or do I need to download some other classes.
> If yes how can I download all the required classes.
>
> The way I understand XalanTransformer is, it can be used as repository of
> compiled stylesheets. In mutli-threaded scenario, I can have a
> XalanTransformer
> class as a static member which will be loaded and compiles all the
> stylesheets
> when the library is loaded and each thread of execution can create
> seperate
>
> XalanTransformer object to do the transformation and destroys it.
> Please let me know if my understanding is wrong.
>
> Thanks,
> Raj.
>
>
>
>
>