[kepler-dev] Threaded actors in the DE Domain

Edward A. Lee eal at eecs.berkeley.edu
Thu Sep 13 11:23:18 PDT 2007


But setDeferringChangeRequests(false) is only one of the ways that
change requests can be executed.  They are also executed in Manager.iterate(),
on every iteration of the model.

I suspect that I have found a bug in DEDirector that would cause
it to block execution of change requests. Basically, it sits in
a loop waiting for events to appear on the event queue (or waiting
for real time to pass if you have synchronizeToRealTime set), but
while in this loop, it essentially ignores calls to its stopFire()
method. These calls occur on each changeRequest, and are meant
to cause the director to return control to the Manager.

I've implemented and checked in a fix in DEDirector.
Can you try removing your executeChangeRequests() call and
see if this solves the problem?

Edward



At 10:01 AM 9/13/2007, ian.brown at hsbcib.com wrote:
>Edward, when I press the run button, ptolemy.actor.Manager.execute() is
>called ... and this runs the model until it is stopped. At the start, the
>initialize() method of this class calls setDeferringChangeRequests(true).
>This basically blocks any change requests.
>setDeferringChangeRequests(false) is only called in the finally clause of
>the execute() method once the model has been stopped.
>
>Ian
>
>
>
>                                                                           
>             "Edward A. Lee"                                               
>             <eal at eecs.berkele                                             
>             y.edu>                                                     To 
>                                       ian.brown at hsbcib.com                
>             13/09/2007 17:04                                           cc 
>             Mail Size: 10560          kepler-dev at ecoinformatics.org       
>                                                                   Subject 
>                                       Re: [kepler-dev] Threaded actors in 
>                                       the DE Domain                       
>                                                                    Entity 
>                                       Investment Banking Europe - IBEU    
>                                                                           
>                                                                           
>                                                                           
>                                                                           
>                                                                           
>                                                                           
>
>
>
>
>
>Ack, the call to executeChangeRequests() defeats the thread safety!
>In fact, the code is equivalent to just doing it in line.
>
>Why is the change request deferred?  What is the DE Director doing
>when the change request is made?  Perhaps there is a bug there that
>we should fix...  To find out, I would try setting a breakpoint
>on the requestChange() line, and look at the state of the other
>(main) thread when this request is made.  I don't understand why
>the request would be ignored...
>
>Edward
>
>
>************************************************************
>HSBC Bank plc may be solicited in the course of its placement efforts for a
>new issue, by investment clients of the firm for whom the Bank as a firm
>already provides other services. It may equally decide to allocate to its
>own proprietary book or with an associate of HSBC Group. This represents a
>potential conflict of interest. HSBC Bank plc has internal arrangements
>designed to ensure that the firm would give unbiased and full advice to the
>corporate finance client about the valuation and pricing of the offering as
>well as internal systems, controls and procedures to identify and manage
>conflicts of interest.
>
>HSBC Bank plc
>Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>Registered in England - Number 14259
>Authorised and regulated by the Financial Services Authority.
>************************************************************
>
>-----------------------------------------
>SAVE PAPER - THINK BEFORE YOU PRINT!
>
>This transmission has been issued by a member of the HSBC Group
>"HSBC" for the information of the addressee only and should not be
>reproduced and/or distributed to any other person. Each page
>attached hereto must be read in conjunction with any disclaimer
>which forms part of it. Unless otherwise stated, this transmission
>is neither an offer nor the solicitation of an offer to sell or
>purchase any investment. Its contents are based on information
>obtained from sources believed to be reliable but HSBC makes no
>representation and accepts no responsibility or liability as to its
>completeness or accuracy.
>_______________________________________________
>Kepler-dev mailing list
>Kepler-dev at ecoinformatics.org
>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev

------------ 
Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal  



More information about the Kepler-dev mailing list