wait 0 doesn't

David Vaughan dvk at dvkconsult.com.au
Wed Apr 30 18:50:01 CDT 2003

On Thursday, May 1, 2003, at 02:04 Australia/Sydney, Ken Norris 
<pixelbird at interisland.net> wrote:


> I don't pretend to understand OSX, but if it uses a pre-emptive method 
> for
> multitasking, then it may allow OS tasking to be held while timing 
> device
> addresses are accessed by the software. That would, indeed, make for 
> more
> accuracy and consistency. I'd bet that means OSX is very regressive on
> machines with slower processors, yes?

Basically, yes. A pre-emptive OS like XP or OS X aka Unix has a 
scheduler which prevents any application from taking processor effort 
beyond a level allocated in its priority setting (which is dynamic as 
it runs but we won't go into that). The foreground app will get most, 
and is guaranteed reasonable service, hence the relative smoothness of 
the figures I produced under OS X despite the fact that a lot else was 
going on at the time. In contrast, OS 9 and earlier basically rely on 
each application yielding at regular intervals to allow other tasks to 
run, called co-operative multi-tasking. The interesting thing is that 
with well written applications having a single overview on their 
priority, co-operative multi-tasking is faster, because its overheads 
are lower, especially noticeable on slower machines. It is just that in 
the real world you do not have that perfect co-operation, nor single 
view of priorities. I believe but can not verify that co-op m-t worked 
very well on early NASA satellites, where code space was at a premium 
and a slower processor running efficient code drew less of the vital 
energy resources.

> Ken N.

More information about the use-livecode mailing list