I need some advice here -
I’m finding something out the hard way and that is…
Where code is placed or where tasks are added to the task manager (within your entire source file)
makes a difference on the execution outcome.
For example, I had a task that ran and stopped when it was done (TaskA). I created another task that pretty much did the same thing as TaskA, but with different values (TaskB). TaskB however, did not stop. That is, it did not call return task.done. TaskB continued to loop.
What I found out was, the rate TaskA executed codes was not the same rate TaskB executed codes. I guess this wouldn’t really be a shocker because TaskA does stop and has to be restarted.
But this is what gets to me…
A new task (TaskC). Task C is like TaskA, that is it starts and then stops and has to be restarted again. The difference is, TaskC is set up higher in the source file (that is, TaskC source code is written way before TaskA source code).
TaskC had a different code execution speed than TaskA, but when I moved TaskC’s source code down where TaskA’s source code was, TaskC and TaskA executed at the same speed!
Someone please clear this up for me! I feel like I’m loosing my mind!
Is this behavior do to the fact I am not setting a priority to tasks when starting them?
What I'm doing: self.MyA = taskMgr.add(self.TaskA, "Atask"); What I'm not doing: self.MyA = taskMgr.add(self.TaskA, "Atask", 4);
If I remember correct, I think Drwr did say I could prioritize my tasks with that extra argument.