|
Re: Quick Question about Threads
You're right, starting a thread in the constructor is wrong. It should be placed in a method named startVision instead of the constructor. Also, we're using thread.sleep instead of thread.yield because it seems to give us more consistent vision loop timings, but I'm not really sure why. It also keeps the cpu usage away from 100%. We know that the vision loop will slow down when other stuff starts up, but it's nice to be able to watch the cpu usage and see what functions use the most resources. What do you think the best way to free up the CPU?
|