axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject RE: cvs commit: xml-axis/java/src/org/apache/axis/server AxisServ er.java
Date Fri, 15 Jun 2001 21:29:10 GMT

Yes, we should be worrying about this.

So after a brief spin through that article, will the following work?

class AxisServer {
  public static AxisServer getSingleton()
  {
    return AxisServerSingleton.singleton;
  }
  ...
}

class AxisServerSingleton {
  public static AxisServer singleton = new AxisServer();
}

And actually, if we condensed it to:

class AxisServer {
  private static AxisServer singleton = new AxisServer();
  public AxisServer getSingleton()
  {
    return singleton;
  }
  ...
}

..would that cause any problems?

--G

> -----Original Message-----
> From: Sam Ruby [mailto:rubys@us.ibm.com]
> Sent: Friday, June 15, 2001 4:50 PM
> To: axis-dev@xml.apache.org
> Subject: Re: cvs commit: xml-axis/java/src/org/apache/axis/server
> AxisServer.java
> 
> 
> > + public static AxisServer getSingleton()
> 
> Do we need to worry about multithreaded callers?  Most 
> servlet engines are
> multi-threaded.  As currently written, it is conceivable that multiple
> "singletons" might be allocated...
> 
> If you are not already aware of the work, some fascinating 
> reading can be
> found at:
> 
>    
> http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
> 
> - Sam Ruby
> 

Mime
View raw message