Hi,

I'm having problems when using more than one Jmol applet to display crystal 
structures on the same page (in the same process).
Typically, one of the applets succeeds, while the others fail with the error

"Unexpected end of file after line 72:
null
for file ...
type Cif"

This occurs, e.g. for a simple page containing only 2 applets, initialised on 
page load, each displaying the zeolite TON (I can send this example page if 
necessary).
One of the 2 applets fails reliably in this case, whereas a single applet never 
fails.
Also, 2 applets displaying molecules always succeeds.

I've seen this problem in Jmol version 13.0.8.
Version 12.0.15 didn't show this problem, at least not reliably enough to be 
noticed.

Is this a bug, or is this scenario, with multiple Jmol applets running in the 
same process, explicitly not supported?

I have been able to work around the problem by forcing each applet to run in a 
separate jvm using an applet parameter ( by adding javascript 
jmolSetParameter("separate_jvm", true); ) although I am concerned about the 
performance implications of this.
Are there any better workarounds?


>From what I have observed so far, it appears that the problem relates to 
>simultaneously accessing the SpaceGroup objects in the static array 
>SpaceGroup::spaceGroupDefinitions in multiple threads 
>(org/jmol/symmetry/SpaceGroup.java). The lazy instantiation of the space group 
>operators makes this particularly hazardous. In principle, accessing the 
>static array  SpaceGroup::canonicalSeitzList could also be a problem.
In practice, I have found that declaring the SpaceGroup::findSpaceGroup method 
to be synchronized removes the problem, i.e.
private static synchronized SpaceGroup findSpaceGroup(String s)

although I wouldn't claim that this is sufficient to make the code thread-safe.


Thanks in advance for any help,
Jim


Accelrys Limited (http://accelrys.com)
Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK
Registered in England: 2326316


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to