Page 2 of 4

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 26 Feb 2011, 09:22
by mattallen37
doc-helmut wrote:...So again my question:
MUST I FOR SURE insert at least a Wait(1) to ALL task loops (also to the very fast ones) for a safe scheduling or not ?
I don't always. Normally, I have my tasks completely independent of each other (no mutexes). Normally, my tasks consist of a while(true) loop, and I don't always have a wait in the loops. IIRC, I have never experienced any issues with this method.

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 26 Feb 2011, 09:26
by HaWe
thx, matt + Xander!
- any other observations about that issue ("MUST I - or not)?

ps:- but now it's supposed to be VERY EARLY in Michigan, isn't it? ;)

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 26 Feb 2011, 09:33
by mattallen37
doc-helmut wrote:thx, matt + Xander!
- any other observations about that issue ("MUST I - or not)?

ps:- but now it's supposed to be VERY EARLY in Michigan, isn't it? ;)
You're welcome.

It is about 4:30 am, so a few hours before sunrise. My dad will probably be getting up soon. Normally, I go to bed half an hour or an hour after he gets up.

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 00:58
by muntoo
John did once say that it is a good idea to use Yield(), but he may have changed the firmware so this is not necessary anymore, and Yield() is just an "artifact" from the stone age of NXC :).

(Currently, we're in the extremely high-tech middle ages. :D)

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 10:12
by HaWe
my question was not about "a good idea" but about a definite answer to "unnecessarily needed or not"

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 10:24
by muntoo
doc-helmut wrote:my question was not about "a good idea" but about a definite answer to "unnecessarily needed or not"
Probably not needed with the new EFs, but we'll need John Hansen to confirm this.

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 10:26
by HaWe
well, "probably" is not the answer that I was looking for...

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 17:13
by mattallen37
I don't think it is. Why don't you just try an example program, and see for yourself? Write a program that uses several tasks at the same time, and don't use waits. See what happens. I don't think the NXT will explode if it doesn't work.

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 17:28
by HaWe
I can't test it in the environment in which I actually need to have it - in my case it's the 14-20 task subsumption program. I will never know if 1 ppm of the BT communications and/or I2C sensor readings and/or priority calculations are faulty or not if I sacrifice all the Wait(1) in all tasks.
But Xander's reply appears to me to be the most confident one so far.

Re: NXC: wait(1) for safe task (scheduling) control needed?

Posted: 27 Feb 2011, 17:36
by mattallen37
Well, that is why I recommended a test program. Often, I write a program just to test a single function or concept.