Should "dispatch" be extended for timers?

Richard Gaskin ambassador at fourthworld.com
Wed Aug 27 14:16:50 EDT 2014


William Prothero wrote:
 > I've wondered what, specifically, "blocking" means. Does it mean that
 > there are no idle messages sent? What is being blocked?

Given this:

on mouseUp
    DoSomething
    send "DoSomethingElse" to me
    DoSomeOtherThing
end mouseUp

on DoSomethingElse
    put 1+1 into gSomeVar
end DoSomethingElse

...then the continued execution of the "mouseUp" handler is effectively 
blocked until DoSomethingElse completes.

But if we change the "send" line to this to defer its operation:

    send "DoSomethingElse" to me in 20 millisecs

...then the mouseUp handler continues on its way to DoSomeOtherThing, 
with DoSomethingElse happening 20 millisecs later, or at first idle if 
other processing takes longer than 20 milliseconds to complete.

So in the first example, the order of messages as they execute is:

1. mouseUp
2. DoSomething
3. DoSomethingElse
4. DoSomeOtherThing

But with the timer introduced in the second example it becomes:

1. mouseUp
2. DoSomething
3. DoSomeOtherThing
4. DoSomethingElse


-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list