View Single Post
  #23   Spotlight this post!  
Unread 24-02-2012, 11:50
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Help me understand PIDController::OnTarget()

Quote:
Originally Posted by jwakeman View Post
I figured. So in QNX parlance (which I am most familar with) these would be a Mutex and Condition Variable. However, I don't see where the semaphore is being flushed in the PIDController implementation. The periodic loop is accomplished with a Notifier calling the Calculate() method periodically. Is the sync actually being used somehow here?
Sounds right, in VxWorks the take and give functions are the same (semTake and semGive) but the semaphores are created differently (semBCreate vs semMCreate vs semCCreate).

Jeez - I've got to stop giving advice from memory - sorry again. Despite the name it seems the Synchronized class is also used for mutual exclusion - weird. The destructor gives the semaphore - I missed that. The Notifier class uses a semaphore for synchronization and the DriverStation has a semFlush example.
__________________
Fast, cheap or working - pick any two!
Reply With Quote