You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bill Barker <wb...@wilshire.com> on 2001/12/06 20:34:51 UTC

Double check idiom broken - Tomcat uses it ?

I'm cross-posting since this started on the user list.

In Tomcat 3.3, JspServlet is largely deprecated (even if not yet
@deprecated).  It is only still included in case some 3.2.x user really
needs it for something.  It is much more likely to be removed in a future
release than fixed.

That being said, we always welcome patches :).

----- Original Message -----
From: "Bo Xu" <bo...@cybershop.ca>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Thursday, December 06, 2001 11:50 AM
Subject: Re: DO NOT REPLY [Bug 4138] - HttpProcessor threads have
inconsistent ClassLoader state


> Dear TOMCAT developers, :-)
>
>
> I forward the following email to you :-)
>
> Bo
> Dec.06, 2001
>
> *****************************************************************
>
> If you really want the developers to take a look at this, you should
> probably post it to the tomcat-dev list. It's iffy whether or not they
will
> see it here.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "java programmer" <ja...@yahoo.com>
> To: <to...@jakarta.apache.org>
> Sent: Wednesday, December 05, 2001 10:44 PM
> Subject: Double check idiom broken - Tomcat uses it ?
>
>
> > Hi all:
> >
> > We all know that the lazy-double-check idiom doesn't
> > apply to Java because of the Java Memory Model (JMM).
> >
> > That is to say, look at code such as:
> >
> > Example a)
> > // Set by any other thread other than #1
> > volatile boolean stop = false;
> >
> > // Thread #1 runs this as long as
> > // stop is false. Only T1 will call this
> > // method, so not synchronized. hence
> > // broken due to staleness of 'stop'.
> > // synch for _visbility_ ALSO.
> > void foo() {
> >  while (!stop ) {  //... }
> > }
> >
> >
> > Example b): The lazy double check idiom
> > public static Foo haha = null;
> > public static getFoo() {
> > if (foo == null ) {
> >   sychronized (Foo.class) {
> >      if (foo == null )
> >             foo = new Foo();
> >   }
> > }
> > return foo;
> > }
> >
> > Both examples are *guaranteed* to be incorrect.
> > Note, this is the case, *even* though I am using
> > 'volatile' for the stop variable. For more on the
> > JMM, consult Item #48 in Effective Java (Josh Bloch),
> > look at Bill Pughs' page at:
> > http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
> > or check out Doug Lea's stuff.
> > Well, here is the thing:
> >
> > Quite idly, and randomly, I was looking at:
> >
> > org.apache.jasper.servlet.JspServlet
> >
> > and I found:
> >
> > <snip>
> > outDated = compiler.isOutDated();
> >    if(!jsw.isInstantiated() || outDated ) {
> >       synchronized(jsw){
> >         outDated = compiler.compile();
> >         if(!jsw.isInstantiated() || outDated) {
> >         if( null ==ctxt.getServletClassName() ) {
> > <snip>
> >
> > This is a complex use of double check type
> > code and is really hard to analyse because references
> > themselves and what they point to can have
> > different levels of staleness (according to the JMM).
> > So it's a turbo double idiom type usage, possibly
> > incorrect.
> >
> > I just wanted to bring this to the attention of the
> > development team and make sure that *someone* has
> > really analysed this according to the JMM. (and
> > any other code, similar to this).
> >
> > Best regards,
> >
> > javadesigner@yahoo.com
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


*----*

This message is intended only for the use of the person(s) listed above 
as the intended recipient(s), and may contain information that is 
PRIVILEGED and CONFIDENTIAL.  If you are not an intended recipient, 
you may not read, copy, or distribute this message or any attachment.  
If you received this communication in error, please notify us immediately 
by e-mail and then delete all copies of this message and any attachments.


In addition you should be aware that ordinary (unencrypted) e-mail sent 
through the Internet is not secure. Do not send confidential or sensitive 
information, such as social security numbers, account numbers, personal 
identification numbers and passwords, to us via ordinary (unencrypted) 
e-mail. 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Load balance with mod-webapp

Posted by William Tansill <wt...@erols.com>.
If you're using mod_web_app, you're probably using Tomcat 4.01.  A number of
people have commented in the recent past that this version of Tomcat does
not support load balancing.

-----Original Message-----
From: Andy Olliver [mailto:andy@slyfrog.com]
Sent: Sunday, December 09, 2001 19:14 PM
To: Tomcat-User
Subject: Load balance with mod-webapp


Hi

Looking through archives and doco and cannot find anything on this.

Does anybody have any pointers on where i can find info.

ie. config instructions for setting up multiple instances of Tomcat behind
single Apache instance when using mod_webapp.

thanks

Andy


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Load balance with mod-webapp

Posted by Andy Olliver <an...@slyfrog.com>.
Hi

Looking through archives and doco and cannot find anything on this.

Does anybody have any pointers on where i can find info.

ie. config instructions for setting up multiple instances of Tomcat behind
single Apache instance when using mod_webapp.

thanks

Andy


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>