Re: brief naps (aftermath)

2003-11-05 Thread Ehud Karni
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, 4 Nov 2003 15:18:00 +0200, Gilad Ben-Yossef [EMAIL PROTECTED] wrote: On Tuesday 04 November 2003 14:43, Ehud Karni wrote: I tested the select call on various machines. 1. It is not accurate enough (2 ms deviations). Yes it does,

Re: brief naps (aftermath)

2003-11-04 Thread Ehud Karni
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 03 Nov 2003 12:30:15 +0200, Ami Chayun [EMAIL PROTECTED] wrote: A couple of results: 1) The rdtscll Pentium instruction (Eran's answer) is very useful. It's super accurate and right now I decided to use it mostly to benchmark other

Re: brief naps (aftermath)

2003-11-04 Thread Gilad Ben-Yossef
On Tuesday 04 November 2003 14:43, Ehud Karni wrote: I tested the select call on various machines. 1. It is not accurate enough (2 ms deviations). Yes it does, you don't seem to use sched_setscheduler in your test program to give your proccess real time priority. setpriority only changes

Re: brief naps (aftermath)

2003-11-04 Thread Ami Chayun
If you don't set your process to SCHED_FIFO or SCHED_RR (only possible as root) and give it realtime priority, you can never be sure to wake up in time (see Gilad's message in the thread). From my understanding, if you recompile the kernel with HZ value higher than 1000, you can use nanosleep or

RE: brief naps (aftermath)

2003-11-03 Thread Ami Chayun
Hi all, First of all, I'd like to thank everyone that have answered, I never expected so many solutions :) A couple of results: 1) The rdtscll Pentium instruction (Eran's answer) is very useful. It's super accurate and right now I decided to use it mostly to benchmark other solutions, and to

RE: brief naps

2003-11-02 Thread Iftach Hyams
There is no problem whatsoever to set the clock to other speeds. , it's jsut a #define in the kernel sources (look for HZ) In kernel 2.6.x this #define is configurable via the regular make *config facility. For 2.4.x there's a patch that accomplish the same and I've used it for several

RE: brief naps

2003-10-31 Thread Iftach Hyams
Hi, I have a question regarding short sleeps (under 10 millisec). 1. Busy wait : It is like the story about Abed (in Yalkut Hakzavim) - Abed could throw a grenade to 80 meters. Once he needed to throw to 50 meters he stepped back 30 ... 2. You can't do idle wait less then 10mSec. The

Re: brief naps

2003-10-31 Thread Gilad Ben-Yossef
On Friday 31 October 2003 10:01, Iftach Hyams wrote: Hi, I have a question regarding short sleeps (under 10 millisec). 1. Busy wait : It is like the story about Abed (in Yalkut Hakzavim) - Abed could throw a grenade to 80 meters. Once he needed to throw to 50 meters he stepped back 30 ...

Re: brief naps

2003-10-30 Thread Shaul Karl
On Thu, Oct 30, 2003 at 10:49:38PM +0200, Ami Chayun wrote: Hi, I have a question regarding short sleeps (under 10 millisec). I require to implement sleep with about 1-10 microsec accuracy (that's no problem), but I require to sleep for times ranging between 1 microsec to 1 millisec.

Re: brief naps

2003-10-30 Thread Ami Chayun
usleep gives you usec accuracy, but the system scheduler can't give you resolution less than 10 millisec quanta... Please correct me if I'm wrong. Ami On Friday 31 October 2003 00:34, you wrote: On Thu, Oct 30, 2003 at 10:49:38PM +0200, Ami Chayun wrote: Hi, I have a question regarding

Re: brief naps

2003-10-30 Thread Eran Tromer
On 2003/10/31 00:34, Shaul Karl wrote: On Thu, Oct 30, 2003 at 10:49:38PM +0200, Ami Chayun wrote: I have a question regarding short sleeps (under 10 millisec). I require to implement sleep with about 1-10 microsec accuracy (that's no problem), but I require to sleep for times ranging between 1

Re: brief naps

2003-10-30 Thread Orna Agmon
On Thu, 30 Oct 2003, Ami Chayun wrote: Hi, I have a question regarding short sleeps (under 10 millisec). I require to implement sleep with about 1-10 microsec accuracy (that's no problem), but I require to sleep for times ranging between 1 microsec to 1 millisec. From my understanding I