joe at otee.dk
Tue Sep 21 14:32:53 EDT 2004
Hi Miguel and Rafael,
> I agree with Miguel, that you don't need specific CoRoutines support,
> just use the Thread class.
> Your code could be transformed in
> void Update ()
> Console.WriteLine ("Starting up");
> System.Threading.Thread.Sleep(20000); // every other thread will
> continue to execute
> Console.WriteLine ("20 seconds later");
I am looking for something less heavyweight than threads.
The game code i am running needs to run synchronously. Also the WaitFor
function was an example and there might be several other Yielding function's
I guess i could do something like create a seperate thread for every update
function which might contain a yield statement. Something like this.
Create Update Function Thread
Run Update Function Thread
void Update ()
Store info about this thread and when to continue the thread
Suspend Update function thread
Some time later from inside the MainThread when 20 seconds have passed or an
animation finished playing call:
Run UpdateThread (This would then finish the update function)
You are right that it's simplest to implement but i don't think it's gonna
cut it performance wise.
I really want to start working a bit on coroutines. I'd really appreciate if
you can give me some hints, starters, help.
More information about the Mono-devel-list