Vivek Singh wrote:

> Hello All,
> I would like to make my servlet application to be thread safe,
> so, i'm trying to implement the SingleThreadMethod interface.
> Can some one throw some light on it how to implement exactly
> and sample code will be appriciated..
>

0
public class myservlet extends HttpServlet
                                    implements SingleThreadModel
{
...

// service   or   doGet   or doPost ...   :-)

}

1
but from several emails in Servlet-List, if:

    a     there are several [copies of myservlet.class] have been
           loaded by several ClassLoaders
    b     only one class, but there are several instances -- instance pool
    c     *   myservlet.class has been loaded/unloaded several times.
           *   instance(s) has/have been made/un_made  several times  ?
           *   instance(s) has/have been reused several times   ?
           *   [init] has been invoked several times

now I don't know if [SingleThreadModel] can [cross them :-)], I think
we need to try for different Servlet engine

2
and from several emails ,  perhaps  we can try to put the
myservlet.class in [system classpath], so it will only be loaded
by [system CLassLoader?] or [Ext CLassLoader?]  -- ? :-)
please [look]  the emails of Gokul Singh  and
Christopher K. St. John.

3
BTW, if we meet a problem,  I guess perhaps the problem
of  [SingleThreadModel]
is a little bit similar with the problem of  [SingleTon]  :-)
and I guess perhaps the problem is because that
Servlet is both a [server] and a [let]   :-)


Bo
Nov.02, 2000

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to