View Single Post
  #2   Spotlight this post!  
Unread 13-11-2013, 01:42
Anupam Goli's Avatar
Anupam Goli Anupam Goli is offline
PCH Q&A co-founder/Scouting Mentor
AKA: noops
FRC #1648 (G3 Robotics)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2008
Location: Atlanta, Georgia
Posts: 1,242
Anupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond repute
Re: Running pid loops in a separate thread.

Multithreading is possible on the cRIO, and in fact, multiple teams have utilized multithreading in their code. I know in C++ you can use pthreads to perform multithreading. I believe in the java api, you either have your class extend runnable or Threads. I'm not 100% sure on that, but you can check out the api to see what you can use. Just be careful with your stack and the memory. In Java, dealing with the stack and memory when multithreading is much simpler than in C, but you still have all of the usual caveats. In C++ you had to make sure certain variables were locked and unlocked when needed unless they were mutexed.
__________________
Team 1002: 2008-2012
Team 1648: 2012-2016
Georgia Tech Class of 2016
Reply With Quote