On Wed, 7 Jun 2006, Bob Hanson wrote:

> Miguel, Egon, other Java pros, I need your help:
>
> Is it possible that when you use static variables in an applet then,
> when there are multiple applets on a page all loading at the same
> time, they share each other's variables? -- i.e. TRASH each other's
> variables?

I haven't done any actual development on Jmol, but I've done a bunch
of work on another applet, so I'll put in my two cents worth...

Yes, this may well be a problem.  We definitely saw this with the applet
I work on; in fact, as I recall even multiple applets on *separate*
pages clobbered each others' static variables.  We went through a big
"get rid of all static variables" process (except for static final
variables, which are of course okay).

One important note, though:  the way browsers deal with applets varies
greatly between different browsers, even within the same family (e.g.,
Mozilla vs. Netscape).

> Now, maybe the "private" takes care of this, but if some other applet
> had assigned values to "argbs", wouldn't this then cause a problem?

I don't think "private" made any difference with the problems we had.
This was two or three years ago, though.  As I recall, the Java spec
really gives browsers a lot of leeway in how they run applets.

It should be pretty simple to test if different applets are actually
trashing each others' static variables.

Good luck!

Kent

---------------------------------------------------------
R. Kent Wenger, Associate Researcher ([EMAIL PROTECTED])

Computer Sciences Department, room 4291
University of Wisconsin-Madison
1210 W. Dayton St.
Madison, WI 53706-1685
608-262-6627 (office); 608-262-1204 (department)
608-233-1840 (home)
Web page: http://www.cs.wisc.edu/~wenger/
---------------------------------------------------------


_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to