I'm spawning a vxworks task (taskSpawn with priority 99). This task is continuously processing data. If the task runs I am not able to enter any commands in the vxworks shell. The tShell task has priority 105.
So how can I enter any commands into the shell. I have a command to stop the task from processing data any further.
The VxWorks scheduler is priority based. Tasks are executed on a first come first serve basis (round-robin is disabled by default).
So if your task runs continuously it blocks all tasks of lower priority (higher number = lower priority in VxWorks) since the scheduler chooses the higher priority tasks to run first.
To deal with that you mainly have the following options:
taskDelay(1);
to your processing loop. This blocks your thread for one system tick and enables threads with lower priority (like tShell in your case) to run.Depending on the scenario I recommend the latter since depending on your task adding a taskDelay(1);
may slow down processing significantly (and increasing the system tick using tickSet(..)
to values above 1000 increases interrupt load dramatically). If you decrease the priority on the other hand your task will run except a higher priority task (e.g. the shell) is ready to run. In that case your task will be interrupted until the higher priority task has finished processing (e.g. your termination command is executed).