Go to Post I have a pair of lucky safety glasses too. When I wear them I never get stuff in my eye. I swear.... - vivek16 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-10-2013, 13:30
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Why is there .01 second delay in teleop on the tutorials?

...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?
Reply With Quote
  #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,043
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
  #3   Spotlight this post!  
Unread 17-10-2013, 14:14
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross 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?
If you are event based, then your idle loop should have a wait in it.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi