From: Miguel <mi...@jm...> - 2006-01-13 12:39:34
|
> Hi=21 > > In reply to my own email from yesterday - To fix this issue the > > setShapeSize and > setShapeProperty methods in > org.jmol.viewer.ModelManager > > need to be declared as synchronized. > If this is correct, could somebody with write permission commit this to= > cvs? Andreas, Your analysis is correct ... in that there is a race condition caused by multiple threads. Evaluation runs as a separate thread ... but I am sure that there are a large number of race conditions that occur when a second string is sent for evaluation while the first is still executing. You recommended: > setShapeSize and > setShapeProperty methods in > org.jmol.viewer.ModelManager > > need to be declared as synchronized. Unfortunately, I do not think that is sufficient. There are a large numbe= r of methods that are at the same level. So, I do not think that marking these as synchronized will be sufficient. The fundamental problem is with evalString and the implementation of Eval= . When a new string is presented it does not queue the string for execution= . In addition, it looks like to me that there is not even a predicate to test whether or not there is something that is still evaluating. I apologize ... for me, it is quite embarrassing. This is a problem that = I have known about for several years. But I think you are the first person to raise it as an issue. For now, you should only send a single string to be executed. A good solution to this problem is non-trivial. To help you with your immediate issue, I will add a predicate so that you can test whether or n= o the eval engine is still running. I will also try to add another entry point that will queue strings to be evaluated. Let's keep talking. Miguel |