Quote Originally Posted by Avatar
Sorry for the question but, what do you call "Cooperative multitasking". Are you talking of some sort of multi-threading ? If it is, then I agree with the fact that it's Evil lol ^^
Say you set up a scripting engine to run a batch of scripts each frame. Exactly which scripts get executed in what order isnt an issue here (That the scheduler's job).

With a Cooperative multitasking scripting engine, the script have to play nice and stop executing when they are done. Basicly the script runs to completion or when ever the script yields.

Thus if you only have a budget of a few milliseconds per frame for the scripts, having a script take 1 minute is going to make a serious difference to the game. And if the script gets stuck in an infinite loop...

With a Cooperative multitasking scripting engine, it doesnt matter how long the scripts take to execute. As with a cooperative multitasking scripting engine it executes a batch of scripts. But if a script doesnt run to completion, it timesout and the scripting engine kicks it out of the hotseat and lets some other script have a slice of time.

Also writing scripts for pre-emptive multitasking scriptign engines means you done have to care about biulding in logic to cope with doing the multitasking. To a script running in a preemptive enviroment, as far as it is consered, it is the one and only script running.