In FirstGlance in Jmol I am using messageCallback more and more. Today I found
why some control javascript that I wrote over a year ago, that relies on
messageCallback, has been behaving strangely and basically not working. I have
been working with Jmol 11.8.14 applet but upgrading is no problem.
It seems that the next messageCallback occurs before the
previous messageCallback has returned. My callback function is currently
returning nothing. Thus, 6 (or possibly more) callbacks can be executing
concurrently and asyncronously with each other. Because I did not anticipate
this, the values of my external variables set in the callback function are set
in an unpredictable way with unpredictable results.
What I observed is that if I put alerts in the callback function, and if those
alerts report the number of the callback (1 for the first callback, 2 for the
second, and so forth) I see 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1. In other words,
callback 6 often (but not always?) completes and returns before callback 1
completes and returns. My interpretation of this is in the previous paragraph.
Is there some way I can force messageCallback to wait for return of the
function it calls before the next messageCallback occurs? If not, I can
redesign some code and hopefully get it to work, but it seems to me that in
general the "wait for return" would be a good thing.
Thanks, -Eric
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users