Thread: Morse Code
View Single Post
  #10   Spotlight this post!  
Unread 02-22-2014, 10:04 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: Morse Code

Don't be afraid of threads. They are a very basic mechanism in any real-time or embedded code development. I know Dave Wilner personally and was involved in the periphery of the Pathfinder problem.

The confusion came as a result of something called the priority inversion problem that is common in real-time systems. In VxWorks, there are 3 different kinds of semaphores that are used for different purposes. The one that's used in the "CRITICAL_REGION/END_REGION" code is the mutual exclusion semaphore that caused the problems for Pathfinder. The problem with Pathfinder was that that semaphore was not created with the SEM_INVERSION_SAFE flag set. However, the constructor used in WPILib automatically set that flag, so you should be good.

Just make sure you protect any global variable accesses in the CRITICAL_REGION/END_REGION wrappers and everything should work fine.

Good Luck,

Mike
Reply With Quote