I'm having problems with a MASON simulation whereby I have a ParallelSequence of RandomSequences that seems to deadlock on the RNG.  When creating the RandomSequences I did specify via the ctor argument that invocations of the RNG to do the shuffle should be synchronized.  (I.e., "shouldSynchronize" is true.)  I see in the debugger that all the ParallelSequence threads are waiting on sim.engine.Schedule, but I cannot find what else has a lock on that.  I *think* that the Schedule.step() itself has a lock on it, but I'm not sure if I'm interpreting the debugger display correctly.  My worry is this language in the RandomSequence documentation: "... and elsewhere in your embedded steppables you're synchronizing on the Schedule first (the Schedule is the basic lock point for MASON's models)."  I'm not sure what that means.  What embedded Steppables?  And where and when should they be synchronizing on Schedule?

As an aside, I'm curious on why there wasn't a synchronize on state.random, itself, instead of the scheduler if all we want to do is eliminate race conditions on the RNG.

(And one consideration for moving MASON up to Java 1.5 support are more concurrent software development goodies such as "volatile" now functioning as a mini-monitor for variables.)

(Also, there is some synchronizing on non-final fields badness, such as the boolean array lock object.)

[log in to unmask]