[Vex C++]How to Multitask

The scheduler in VCS is cooperative, that means that threads should try and yield time to the others if they have no immediate processing to do. Loops that are using API functions, things like setting motors or checking the controller, will automatically be forced to yield if they run for too long. Loops that do not use API functions would block all other threads from running so this…


while(1) {
  ;
}

Would not be good idea.
ROBOTC could handle loops like that as it used a virtual machine. As code compiled for the V5 is native that’s much harder to achieve.

1 Like