*BSD News Article 69915


Return to BSD News archive

Newsgroups: comp.unix.bsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!caen!spool.mu.edu!usenet.eel.ufl.edu!bofh.dot!tank.news.pipex.net!pipex!usenet1.news.uk.psi.net!uknet!uknet!newsfeed.ed.ac.uk!edcogsci!richard
From: richard@cogsci.ed.ac.uk (Richard Tobin)
Subject: Re: kernel/context switch
X-Nntp-Posting-Host: pitcairn
Message-ID: <Ds2L4x.6zw@cogsci.ed.ac.uk>
Sender: cnews@cogsci.ed.ac.uk (C News Software)
Organization: HCRC, University of Edinburgh
References: <4ntet4$7mv@ennui.eng.octel.com> <4nvf95$4as@helena.MT.net>
Date: Mon, 27 May 1996 15:17:21 GMT
Lines: 29

In article <4nvf95$4as@helena.MT.net> "Nate Williams" <nate@sneezy.sri.com> writes:
>The time spent scheduling & saving/restoring the context of the
>processes becomes significant the smaller you make your quantum.

>Let's say it takes 2ms.  So, with a 100ms quatnum, you lose about 2% of
>the CPU time for straight overhead of the context switch time.

2ms might have been plausible a few years ago, but on current machines
it's closer to a tenth of that.  I get about 5000 switches/second on a
Sparc 5/110 or a 486DX2/66, about 3000 on a Sparc IPX (slow by today's
standards).

This suggests that the quantum could reasonably be made much smaller.
I'll try it on my FreeBSD system sometime and see if it feels any
different.

I doubt that the effect will be very noticeable.  I remember a case
long ago where it was very obvious: running two copies of a simple
"bouncing line" program on an Apollo workstation.  Each would run for
a couple of seconds in turn.  That shouldn't happen - even for a tenth
of a second - under X, since the system is constantly switching
between the X client and server anyway.  Can anyone suggest a
situation where it's likely to have a noticeable effect?

-- Richard
--
How to have fun on Usenet, #1:  Post a message to alt.sex saying "please
take me off the Cindi Crawford nude pix mailing list, it's filling up my
mailbox".  Be sure to set followups to include misc.test and sci.aquaria.