Title: Basic servlet threading question
Hi Erik,
variables defined inside a method are local to a method irrespective of whether it is a servlet method or any other ordinary java class method.
And every thread accessing a particular method has its own memory on the heap for storing local variables.
 
Hence , in case of servlet, you have to worry only about the variables declared at the class level.
-meera
 
-----Original Message-----
From: Erik Beijnoff [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 6:40 AM
To: [EMAIL PROTECTED]
Subject: Basic servlet threading question


What do I have to take into consideration when it comes to servlet
multithreading?

I know that an variable defined in the body of the servlet is shared among
all requests, but what about variables defined in the methods, for example
in doGet(). Is that shared to? And what about a variable defined within a
for loop?

Best regards
Erik Beijnoff
Systems development
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Reply via email to