View Single Post
  #13   Spotlight this post!  
Unread 31-03-2010, 09:33
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Suggestion for next year's WPILib

Quote:
Originally Posted by Greg McKaskle View Post
I won't profess to know VxWorks inside and out, but killing threads is commonly a dangerous task if you do not control what the task is up to and allow it to get to a good place first. This is why LV Abort is somewhat cooperative and doesn't simply kill threads. It is still reasonable to do this within WPILib, just not as simple to pull off.

Greg McKaskle
It's not just VxWorks, but pretty much any OS - killing off a thread without giving it a chance to release any resources it might be using is generally bad. It's not that difficult, however, to make a thread that just loops until you send a message to it to exit. Then to kill the thread, you just send the exit message, the thread gets out of its main loop, cleans up, and exits.

Also, for a nice explanation of the VxWorks multitasking model, share and enjoy.
__________________

Last edited by slavik262 : 31-03-2010 at 09:36.
Reply With Quote