RE: scheduling order
"Marcin Pilat" <[email protected]>
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <000001c3c40c$40702990$6401a8c0@dabear> |
Thanks for the reply. Attached is a sample file to demonstrate this. There is 3 commented lines ABC - use only one at a time. If you uncomment line #A the behaviour is a direct call and order is preserved (top to bottom coloring). If you uncomment line #B the bahaviour is also preserved - this is my own scheduling using the init method and a timer. If you uncomment line #C the behaviour is not preserved - this is the scheduler. Marcin > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of jon klein > Sent: December 16, 2003 12:04 PM > To: [email protected] > Subject: Re: [breve] scheduling order > > > On Dec 16, 2003, at 1:20 PM, Marcin Pilat wrote: > > > Direct call: > > > > If RunMeFirst directly calls the RunMe method, then obviously the > > evaluation order of the objects' RunMe method is preserved based on > > the RunMeFirst method. > > > > Schedule call: > > > > If RunMeFirst calls the scheduler to schedule the RunMe method after a > > fixed time (eg. 1) then the evaluation order of RunMe is independent > > on the evaluation order of RunMeFirst. > > I'm not sure that I fully understand the problem you're having, but I > think what you're describing is the expected behavior. I also see how > it could be problematic. > > In general, the execution order of things scheduled for the same time > by the breve engine is undefined. So if you have two objects > scheduling a method call for the same time, you can't rely on one being > called before the other. This applies to other methods the engine > calls as well, such as the "iterate" method. > > When execution order is important, generally the best thing to do is > call the methods explicitly from another object which will manage the > execution (for example, the Controller object might be used). So > instead of scheduling RunMe for both of the objects, you would > schedule a call for the manager object, which will in turn call the > RunMe method for both objects. > > That said, I see how it could become tedious--it should be relatively > straightforward to change the order of the scheduled method calls in > breve, so I'll look into that. > > - jon klein > > _______________________________________________ > breve mailing list > [email protected] > http://www.spiderland.org/mailman/listinfo/breve _______________________________________________ breve mailing list [email protected] http://www.spiderland.org/mailman/listinfo/breve
sched-order-test.tz
(application/octet-stream, 2.7 KB) - not displayed