|
Re: Thread Safety/Reentrancy in WPILib
It's not that I want to set the speed of the same motor from different threads, but that I want to set the speeds of different motors from different threads. However, depending on how the cRIO communicates with the digital sidecar, it might pose a problem. For example, if it uses a serial command format, and, let's say we want to turn on two motors at the same time from different threads. Usually, it would send the open command followed by the motor ID. However, if we were unlucky, it would send the open command to turn on the first motor, and then it would switch threads to the other motor thread. That thread would then send its open command, which would be interpreted by the digital sidecar as a motor ID, causing sporadic motor movement.
|