Tasking (Background tasks)?

Jan Schenkel janschenkel at yahoo.com
Wed Jun 9 16:34:55 EDT 2004


--- K <nnoydb at excite.com> wrote:
> 
> 
> I have read the Messages Mechanics stack and have a
> few questions.  
> 
> 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.
> 
> Kevin
> 

Hi Kevin,

Revolution is a single-threaded environment (which
avoids all the "happy-funny" bits of multi-threaded
environments such as Java) and 'send' is a great way
of giving us more control.
A few commands work with callback messages but this is
something that is not easy to mimick in your own code.

Your best bet is to span off new processes and use the
read and write process commands, but those don't work
on all platforms.
Wait with messages can be a partial solution, but for
intensive tasks it's better to handle them asap
anyway, rather than pushing more and more tasks up the
message queue.

Just my two euro-cents,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


More information about the use-livecode mailing list