View Single Post
  #4   Spotlight this post!  
Unread 04-30-2010, 12:22 AM
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Feedback Thread: WPILib

One of the things that I found difficult to work with in WPILib was the approach for creating and maintaining threads. There is a good model for this in C++ in the form of the Open Source Thread Building Blocks put out by Intel. There is an O'Reilly book on the TBBs as well. So, it's open source *and* documented :-).

Another issue that I've encountered is that within the Teleop control loop, the Wait() is implemented as a taskDelay. This causes the teleop loop task to go to sleep forcing it to lose contact with the operator. Normally, in a real VxWorks system, we'd have a thread that would be blocked on a binary semaphore and a watchdog timer (via wdCreate/wdStart) that would give the semaphore after the expiration of the timer. Or, create a thread and put it into a timed semTake call. This really relates to the way the code is designed for operating in teleop mode.

Another alternative for this would be to use the semaphore event mechanism to effectively deliver a signal (non real-time hack alert ;-), to allow the teleop loop to continue to run without putting the task to sleep. The concern that I have is that the kids don't realize the effect of using the Wait() call on their code and this makes the cRIO appear to not be fast enough.

HTH,

Mike