From: Hedayat V. <hed...@ai...> - 2008-01-27 19:57:46
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html style="direction: ltr;"> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> </head> <body style="direction: ltr;" bgcolor="#ffffff" text="#000000"> <span>Hi,<br> First, I think that the loop isn't a problem too. And I wonder if SDL_GetTicks() creates any major problem now.<br> But the multi-threaded ODE might be really helpful. <br> <br> Second, would you please how do you profile the server? Each of us gets different results and I wonder why is so. Also, for the profiling results I provided in my previous mail I used valgrind's tools. As it is really slow, I used just one robot in those tests. Please tell me about the ways you use for profiling the server.<br> <br> Finally, It would be really nice if you tell me your opinions or the mistakes in the patch I sent with my email recently(in the email with subject: "some experiments with the server"). Also, I'm really interested to know about the answer of the 4th question.<br> <br> Thanks anyway,<br> Hedayat<br> <br> <style type="text/css">blockquote {color: navy !important; background-color: RGB(245,245,245) !important; padding: 0 15 10 15 !important; margin: 15 0 0 0; border-left: #1010ff 2px solid;} blockquote blockquote {color: maroon !important; background-color: RGB(235,235,235) !important; border-left-color:maroon !important} blockquote blockquote blockquote {color: green !important; background-color: RGB(225,225,225) !important; border-left-color:teal !important} blockquote blockquote blockquote blockquote {color: purple !important; background-color: RGB(215,215,215) !important; border-left-color: purple !important} blockquote blockquote blockquote blockquote blockquote {color: teal !important; background-color: RGB(205,205,205) !important; border-left-color: green !important}</style><i><b>"Yuan Xu" <a class="moz-txt-link-rfc2396E" href="mailto:xuy...@gm..."><xuy...@gm...></a></b></i> wrote on 01/27/2008 06:01:45 PM:</span><br> <blockquote style="border-left: 2px solid rgb(16, 16, 255); color: navy; background-color: rgb(245, 245, 245); padding-left: 15px;" cite="mid:18a...@ma..." type="cite"> <pre wrap="">Hi Hesham and all, </pre> <blockquote type="cite"> <pre wrap="">After profiling the server I saw SDL_GetTicks() is taking around 25% of the time (in the tests I used 7 robots and with the single thread mode). To make long short, I saw this loop (while) in simulationserver.cpp: .... Since SimulationServer::Step() takes care of this case (int(mSumDeltaTime*100) < int(mSimStep*100)) I thought that while in Run() is not necessary. So after commenting it out, SDL_GetTicks() takes less than 10% of the time: </pre> </blockquote> <pre wrap=""><!----> The phenomenon is reasonable. Since the time queries are needed for timing in single thread, the percentage of queries means that your machine are light underload( not too busy ), I guess your robots did not do anything. You will notice that the percentage of queries will lower if robots are collides... But if you remove the codes, the timer is noneffective. Then if the robots collides, the server will very very slow, otherwise the simulation time elapse very quickly. You may ask why use query to get time, ok, I do not think it is a good idea. The server cycle is 20ms, but the time precision of Linux is only 10ms, some function such as "sleep" also can not help on it. In fact, SDL_GetTicks() is used to get "preciser"(seemly). And it is possibly that SDL causes the Input problem in multi-threads. I have some idea to this: 1. to get precise time, use RealTime-Linux as platform [It will narrow OS platform] 2. use a new thread to time, The timing is in InputControl thread in current multi-thread implementation, but query is also used(It can be improved little). [It may make the timing-thread busy, and can not guarantee precision.] 3. use other timer instead SDLTimer, such as boost::xtime. [It need more investigation.] </pre> <blockquote type="cite"> <pre wrap="">BTW, the other day I came across the multi-threaded version of ODE by Intel. </pre> </blockquote> <pre wrap=""><!----> Sounds interesting. </pre> </blockquote> <br> </body> </html> |