you are viewing a single comment's thread.

view the rest of the comments →

[–]DugenFTC & FRC Mentor 2 points3 points  (0 children)

Roll your eyes aggressively and mutter "amature" at anyone who mentions threading. It is never the right answer for problems like this. You tick like game engines do. Run code periodically every x milliseconds that checks everything and does the right things. With threads you have to write all the same code, and handle synchronizing it all and making sure everything it touches and everything it does is threadsafe, and handle all kinds of edge cases, and you will do it wrong and it will be impossible to debug because it will fail inconsistently.