Tasking (Background tasks)?

Brian Yennie briany at qldlearning.com
Wed Jun 9 16:38:26 EDT 2004


Wait with messages is one option that will allow other messages to be 
sent and executed. Another is to use "send" to process things in 
chunks, such as:

on mouseUp
     loadSomeData
end mouseUp

on loadSomeData
    if (dataLoadingComplete() = TRUE) then
        ...
       send "loadSomeData" to me in 50 milliseconds
    end if
end loadSomeData

By using send, you are essentially "yielding" until the next message is 
delivered, and you can specify how much time you want to give up- the 
above example giving 50 milliseconds between chunks of processing. I've 
never compared "send" to "wait with messages" directly, but I presume 
"wait" will give you the tightest loop while "send" offers the most 
flexibility.

HTH

> I realize that it is the accepted method of taking in the RR 
> environment but I am wondering if there are not any simple cooperative 
> multi-tasking constructs.  I am loading a significant amount of data 
> using a repeat loop I would like at the approiate time to yeild to any 
> other tasks.  Can I accomplish this by using wait for messages?  Has 
> someone already built cooperative tasking API or LIB? Is it even 
> possible.  Since using a WAG to dealy a function is contrary to many 
> multi-tasking concepts.



More information about the use-livecode mailing list