From: Radu B. R. <ru...@cs...> - 2007-01-30 12:35:12
|
John Oliver wrote: > My initial thought would be that looking at the code if you pass -1 to a > runThreaded then the PlayerClient will only yield in between each read() > function to the simulator. This will then allow other threads to execute, > if there are none requiring execution then it will come back almost > immediately and issue another read(), this could then mean that you are > spamming the simulator with thousands of read requests a second, on top of > the read request that is in the main loop of the circleWalk. Just one remark here... if you are running in threaded mode, but you also attempt to read "manually" from your main loop, the read will return and do nothing, because: --- public int readAll () { if (isThreaded) return 0; ... --- Also the Space Wanderer example should contain a Thread.sleep () which assures that your main loop is not going to execute too fast. Other than that, I agree with John that it would be good to view how much CPU time does a process consume. It might be Java but it might be something else as well. If it's running in Stage just fine, I think we are hitting a bottleneck somewhere (?). Radu. -- | Radu Bogdan Rusu | http://rbrusu.com/ | http://www9.cs.tum.edu/people/rusu/ | Intelligent Autonomous Systems | Technische Universitaet Muenchen |