You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Robin Green <gr...@hotmail.com> on 2000/05/06 19:40:54 UTC
REPOST: Possible multithreading bug in XSPJavaProcessor
on Fri, 28 Apr 2000 I wrote
>
>I'm not the world's greatest expert on multithreading, but can I humbly
>suggest that there might be a lurking bug in XSPJavaProcessor?
>
>As far as I can see, the only sychronization in Cocoon is
>1) when creating the engine
>2) the MemoryStore
>and 3) an XSPUtil function (not relevant).
>
>So although there is MemoryStore synchronization, there is no
>synchronization related to the .java and .class files which are created by
>XSP. So you could theoretically have one thread partway through writing a
>file, and another thread reading that file - causing a hard-to-fathom
>error.
>
>So I suggest synchronizing on compile(), and load() in XSPJavaProcessor,
>and
>on whatever writes the .java file to disk (synchronizing on the same object
>in all three cases). It introduces a bottleneck, but we can't edit the
>compiler, so it's the best we can do.
>
>Or have I missed something obvious?
>
>
>--
>Robin
>
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Re: REPOST: Possible multithreading bug in XSPJavaProcessor
Posted by Ricardo Rocha <ri...@apache.org>.
Caramba, a repost!
This is a very important bug fix and will be applied asap
(with all due credits).
Thanks Robin!
On Sat, 06 May 2000, Robin Green wrote:
> on Fri, 28 Apr 2000 I wrote
>
> >
> >I'm not the world's greatest expert on multithreading, but can I humbly
> >suggest that there might be a lurking bug in XSPJavaProcessor?
> >
> >As far as I can see, the only sychronization in Cocoon is
> >1) when creating the engine
> >2) the MemoryStore
> >and 3) an XSPUtil function (not relevant).
> >
> >So although there is MemoryStore synchronization, there is no
> >synchronization related to the .java and .class files which are created by
> >XSP. So you could theoretically have one thread partway through writing a
> >file, and another thread reading that file - causing a hard-to-fathom
> >error.
> >
> >So I suggest synchronizing on compile(), and load() in XSPJavaProcessor,
> >and
> >on whatever writes the .java file to disk (synchronizing on the same object
> >in all three cases). It introduces a bottleneck, but we can't edit the
> >compiler, so it's the best we can do.
> >
> >Or have I missed something obvious?
> >
> >
> >--
> >Robin
> >
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Re: REPOST: Possible multithreading bug in XSPJavaProcessor
Posted by Ricardo Rocha <ri...@apache.org>.
Synchronization on code generation, compilation and loading has been
added to XSP as pointed out by Robin Green (thanks Robin!).
In order to minimize contention, synchronization is forced on the
transient "pageEntry" object, so that only 2 requests competing
for the same page are synchronized.
On Sat, 06 May 2000, Robin Green wrote:
> on Fri, 28 Apr 2000 I wrote
>
> >
> >I'm not the world's greatest expert on multithreading, but can I humbly
> >suggest that there might be a lurking bug in XSPJavaProcessor?
> >
> >As far as I can see, the only sychronization in Cocoon is
> >1) when creating the engine
> >2) the MemoryStore
> >and 3) an XSPUtil function (not relevant).
> >
> >So although there is MemoryStore synchronization, there is no
> >synchronization related to the .java and .class files which are created by
> >XSP. So you could theoretically have one thread partway through writing a
> >file, and another thread reading that file - causing a hard-to-fathom
> >error.
> >
> >So I suggest synchronizing on compile(), and load() in XSPJavaProcessor,
> >and
> >on whatever writes the .java file to disk (synchronizing on the same object
> >in all three cases). It introduces a bottleneck, but we can't edit the
> >compiler, so it's the best we can do.
> >
> >Or have I missed something obvious?
> >
> >
> >--
> >Robin
> >
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com