View Single Post
  #2   Spotlight this post!  
Unread 17-10-2013, 13:44
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Why is there .01 second delay in teleop on the tutorials?

Quote:
Originally Posted by ekapalka View Post
...so is it considered good practice to add it in? If your code is entirely event based (or using threads), would you really need it?
It depends on how you implement the thread. If you create a thread which runs continuously in an infinite loop within the thread, then you need to slow down the frequency of that loop by yielding the processor for a period of time every pass through the loop.

If the thread is created, does its thing, and then exits, you don't need the yield in the thread. You just need to make sure that the parent process that is creating that thread limits the frequency at which it creates the thread.



Last edited by Ether : 17-10-2013 at 13:47.
Reply With Quote