I'm really getting to like the Send command.
But I'm a little hesitant about using them more often,
due to concern on how they'll interact with other Handlers.
What happens when 2 or more send commands are concurrent?
Lets say I have 2 handlers: handler.one & handler.two.
handler.one takes a long time. Say 2 minutes to complete.
But during that 2 minutes another Send command triggers handler.two.
which only takes a moment to complete. Does it get precedence?
Is there any way to control precedence?
Or do CPU cycles get split evenly?
Precedence of Send commands
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Precedence of Send commands
townsend,
have a look here
http://forums.runrev.com/phpBB2/viewtop ... 340#p58383
which references Dar Scott's Primer on Message Mechanics
http://pages.swcp.com/dsc/revstacks.html
it is the most thorough sample/description of "send" I know.
as far as your question is concerned: difficult to say, is handler.one blocking? Or has it a wait with messages part? If handler.one runs and suppose it is blocking who could issue the 2. send? If the 2. send was issued before handler.one started but was timed to a time during execution of handler.one it will execute handler.two after handler.one finishes.
Well I guess it all depends. But Dar Scott does a tremendously good job of covering all the possibilities.
Kind regards
Bernd
have a look here
http://forums.runrev.com/phpBB2/viewtop ... 340#p58383
which references Dar Scott's Primer on Message Mechanics
http://pages.swcp.com/dsc/revstacks.html
it is the most thorough sample/description of "send" I know.
as far as your question is concerned: difficult to say, is handler.one blocking? Or has it a wait with messages part? If handler.one runs and suppose it is blocking who could issue the 2. send? If the 2. send was issued before handler.one started but was timed to a time during execution of handler.one it will execute handler.two after handler.one finishes.
Well I guess it all depends. But Dar Scott does a tremendously good job of covering all the possibilities.
Kind regards
Bernd
Re: Precedence of Send commands
Messages that are sent will only trigger during the next idle. If the 2-min handler doesn't have any "wait with messages" in it, then the second "send" will never even trigger until the first handler is completed.
If the long handler does allow idle cycles, then whichever "send" should occur earliest will trigger during the idle. The originally running handler will pause until the sent message handler completes, then resume its long process.
Only one handler can be running at any time.
If the long handler does allow idle cycles, then whichever "send" should occur earliest will trigger during the idle. The originally running handler will pause until the sent message handler completes, then resume its long process.
Only one handler can be running at any time.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com