tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luba Powell" <luba...@bellatlantic.net>
Subject Re: MultiThreadModel-Problem?
Date Thu, 14 Jun 2001 17:50:57 GMT
No, nothing like that.  It is a feature of JVM (and most operating systems).
 Class and instance variables  can be accessed by other thread in the same
JVM.  Only local variables are not exposed.  There are numerous ways to
protect the integrity of class and instance data.  However, if you are new
to the multi-threaded
environment you might want to use a single threaded servlet model first.

Since this is not a tomcat question - please write to me directly and I can
explain you further the cons and pros of each model.

R/Luba

----- Original Message -----
From: <silvio.c.l.terra@exgate.tek.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Thursday, June 14, 2001 12:50 PM
Subject: RE: MultiThreadModel-Problem?


> I'm new to all this, but is this (HttpServlet not being thread safe) a
> Tomcat problem, or just a general JSP problem, which will show up no
matter
> what server I use (weblogic, for instance)?
>
> -----Original Message-----
> From: Luba Powell [mailto:luba999@bellatlantic.net]
> Sent: Thursday, June 14, 2001 8:20 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: MultiThreadModel-Problem?
>
>
> HttpServlet is not thread safe.  Synchronize your code where needed
>
> ----- Original Message -----
> From: "Sebastian Schulz" <sebastian.schulz@sebastian-schulz.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Thursday, June 14, 2001 11:08 AM
> Subject: MultiThreadModel-Problem?
>
>
> > hi,
> >
> > i use a servlet in MultiThreadModel-mode (default).
> > when 2 users at the same time makes the same request
> > to the servlet (a operation that needs a bit) it seams, that
> > only the request of the user who was perhaps a millisecond
> > earlier is responded correct, the other seams to be ignored.
> >
> > (i think, this is perhaps a concurency-problem, but i do not use
> > static variables and could not find an error)
> >
> > the second question is:  data-container like HashMap or HashSet
> > are considered to be not Thread-save. Can i use such containers
> > in a MultiThreadModel-Servlet or must i use only slower structures
> > like Vector?
> >
> > your help is realy needed, many thanks
> > in advance!
> >
> > basti
> >


Mime
View raw message