Stijn Hoop wrote:
> On Mon, Dec 02, 2002 at 11:49:03AM -0600, Mike Silbersack wrote:
> > The time select() takes should be directly related to your system's hz
> > setting.  The default for FreeBSD is 100, which means that the interrupt
> > timer will fire every 10ms.  If you want to play with that, edit
> > /etc/sysctl.conf and set kern.hz="1000", which should give you 1 ms
> > accuracy.
> 
> With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am
> indeed seeing much better times on this 'benchmark'. See attached log. Not
> only the _select_sleep method benefits from this. What are the reasons *not*
> to do this?

Increased context switch overhead.


> > As to why Linux may appear "better"... I believe that Linux defaults to
> > hz=100, but that the default switched to hz=1000 sometime in the recent
> > past.
> 
> And why don't we do the same? (I suspect this is related to the question
> above :)

Increased context switch overhead.


> > To answer your final question:  Sleep accuracy doesn't matter to most
> > applications, but I'm sure counterexamples could be found.
> 
> Such as emulators :)

Actually, for the case you are talking about, your emulator should
be using aggregate instead of discrete timeouts, and you would not
be having a problem.  It's not useful to do 100 1ms timeouts to
achieve a  100ms timeout, when you can ask for a single 100ms
timeout.  I would count this as a bug in your emulator.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to