On Wed, 19 Sep 2001, Graham, Billy wrote:
> Hi comrades.
>
> As requested I have posted the 'dodgy' section of code (see below).
> There are 3 counter variables used within this section of the method
> (doGet()) that are all defined at the class level (i.e. right after
> the Class definition, what I would refer to as global variables).
That's probably your problem right there. The way you've declared
them, they are instance variables (Java doesn't really have global
variables, but instance variables are kind of like class global
variables), which are dangerous in a multi-threaded environment --
each instance has only one of them but they're shared across threads.
You should make them local to the method.
> I'm fairly sure I have tried defining them locally with no change in
> the bug (though I may be mistaken here as I've tried a lot of things
Well, try it again (for the first time). It's possible there is
another problem, but this looks like a prime culprit.
> over the last week or so). The counter variables are PlotsDrawn,
> TotalPlotsDrawn, TotalScreensDrawn. The variable that seems to
> change 'at will' is the 'PlotsDrawn' one. The variable 'Plots' is
> hardcoded a value of 3.
[ ... ]
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
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