Tasking (Background tasks)?

K nnoydb at excite.com
Wed Jun 9 22:44:43 EDT 2004



This is not something that easily use the send in time construct.  I do not wish to waste the run-time a send in WAG requires.  What is the approiate construct to use so that several very intense repeat loops will get equal time?  I have been using wait for messages which did not function as I would have expected.  It seems that wait for messages only allow "new" habdlers to proceed nut does not yeild control to a handler already running a repeat construct.  Maybe this is a question I should ask of the RR support.  Any ideas?


Kevin

NOTE: Might there be a doEvents type construct which would allow 2 routines in tight loops to execute?



-==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=-
Disclaimer:

Any resemblance between the above views and those of my
employer, my terminal, or the view out my window are purely
coincidental. 
Any resemblance between the above and my own views is non-deterministic.

 The question of the existence of views in the absence of anyone to hold
them
is left as an exercise for the reader. The question of the existence of
the reader
 is left as an exercise for the second god coefficient. 
(A discussion of non-orthogonal, non-integral polytheism is beyond the
scope of this article.)



 --- On Wed 06/09, Brian Yennie < briany at qldlearning.com > wrote:
From: Brian Yennie [mailto: briany at qldlearning.com]
To: nnoydb at excite.com, use-revolution at lists.runrev.com
Date: Wed, 9 Jun 2004 16:38:26 -0400
Subject: Re: Tasking (Background tasks)?

Wait with messages is one option that will allow other messages to be <br>sent and executed. Another is to use "send" to process things in <br>chunks, such as:<br><br>on mouseUp<br>     loadSomeData<br>end mouseUp<br><br>on loadSomeData<br>    if (dataLoadingComplete() = TRUE) then<br>        ...<br>       send "loadSomeData" to me in 50 milliseconds<br>    end if<br>end loadSomeData<br><br>By using send, you are essentially "yielding" until the next message is <br>delivered, and you can specify how much time you want to give up- the <br>above example giving 50 milliseconds between chunks of processing. I've <br>never compared "send" to "wait with messages" directly, but I presume <br>"wait" will give you the tightest loop while "send" offers the most <br>flexibility.<br><br>HTH<br><br>> I realize that it is the accepted method of taking in the RR <br>> environment but I am wondering if there are not any simple cooperative <br>> multi-tasking constructs.  I am loading a significant amount of data <br>> using a repeat loop I would like at the approiate time to yeild to any <br>> other tasks.  Can I accomplish this by using wait for messages?  Has <br>> someone already built cooperative tasking API or LIB? Is it even <br>> possible.  Since using a WAG to dealy a function is contrary to many <br>> multi-tasking concepts.<br><br>

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


More information about the use-livecode mailing list