View Single Post
  #3   Spotlight this post!  
Unread 15-01-2012, 14:23
POSIXGuru POSIXGuru is offline
Registered User
FRC #1389 (The Body Electric)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Walt Whitman High School
Posts: 3
POSIXGuru is an unknown quantity at this point
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.
Reply With Quote