Kamilah Taylor
I'm finding an interesting application of operating systems to coding and debugging my little robot -- tentatively named HAL 0.

Interestingly, the NXT not only supports multithreading, it can have up to 255 threads. NXC (Not eXactly C) calls these threads tasks. We also have to deal with mutexes, which is necessary when you consider the consequences of having parallel threads all trying to control the motors.

My understanding thus far is that
(1) You always have a main task. This task is executed first, sets what sensors are connected to which ports, and can determine the order in which the other tasks are started.
(2) If you want task 2 to start after task 1, you can start it off with a Follows(task 1) command. I suspect, however, that this is part of the problem I'm having with switching mutexes between tasks. Unfortunately the StartTask command doesn't seem to work and since NXC is kinda like C, I can't use a StartTask(task 2) command in task 1 because task 2 hasn't been defined yet. Oh the joys of C.

In the course of writing this post, I've had a bit of an epiphany, so I may edit this post later today...
Labels: , , , | edit post
0 Responses

Post a Comment