[futurebasic] Re: Yielding Processor

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: BMichael <BMichael@...>
Date: Fri, 5 Dec 1997 14:22:25 EST
>While still learning about  the FBII environment, I'm developing a tool
>that's pretty computationally intensive.  I'd like to yield some of the
>processor back to other applications, so they can do their thing for a while
>before I continue. Is there an easy way to do this? Does the DELAY command
>yield the processor to other threads?

The "preferred" approach is to fall into your event loop every so often, 
so the user can switch _your_ app to the background, or whatever. You do 
this generally by doing your computations on "null" events, perhaps while 
displaying a progress bar.

Another way, if you _don't_ want the user to be able to switch out, but 
want to allow, for example, a network app running in the background to go 
get email (while remaining in the background) is to stick "CALL 
SYSTEMTASK" in your computation loop. This is _only_ recommended if you 
absolutely, positively, _must_ stay in the foreground.

The delay command does not yield the processor.