[kepler-dev] Can "stop" interrupt "initialize()"

Edward A. Lee eal at eecs.berkeley.edu
Wed Feb 1 11:27:03 PST 2006


At 11:22 AM 2/1/2006 -0600, Kevin Ruland wrote:
>1) Should CompositeActor release the read-lock prior to making the open
>call to the director's preinitialize()?

This would have to be done very carefully.
If you don't hold a read lock, then the structure of the model
can change at any time.  If you are iterating through a list of actors
to preinitialize them, for example, and the list of actors changes
while you are iterating through it, you could get into trouble.

The "right" way to mutate the model is by queueing a ChangeRequest.

Edward


------------
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal  




More information about the Kepler-dev mailing list