Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!uunet!kddlab!ccut!titcca!sragwa!wsgw!socslgw!diamond From: diamond@csl.sony.co.jp (Norman Diamond) Newsgroups: comp.std.c Subject: Re: observability Message-ID: <10827@riks.csl.sony.co.jp> Date: 13 Sep 89 02:54:46 GMT References: <1237@gmdzi.UUCP> <10885@smoke.BRL.MIL> <242@ssp1.idca.tds.philips.nl> <10937@smoke.BRL.MIL> <1989Sep6.160709.4890@light.uucp> <1989Sep6.183349.2866@jarvis.csri.toronto.edu> <28946@news.Think.COM> <1989Sep8.091010.12450@gdt.bath.ac.uk> Reply-To: diamond@ws.sony.junet (Norman Diamond) Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 32 In article <1989Sep8.091010.12450@gdt.bath.ac.uk> exspes@gdr.bath.ac.uk (P E Smee) writes: > -- though one might ask why you would want to write a chunk >of code that has ZERO effect. >(The counter-example people inevitably come up with is 'maybe the >program is meant to be a timing loop'. The tired answer is 'if you >want a time delay, you should tell the operating system to put you to >sleep for some period of time, rather than wasting CPU cycles twiddling >your thumbs. The other users of your multi-user system will thank you >for it.) If it takes longer to process an interrupt than to wait for a certain hardware operation to finish, then the other users will thank you for coding your no-ops. If the kernel is trying to access a shared list of task control blocks, and the list is locked (for a very short time) by another processor's kernel, and the kernel decides not to crash the system by trying to put itself to sleep, then the other users will thank you for it. Yes, people sometimes write timing loops in Fortran or C, for exactly the same reason as people sometimes write kernels, device drivers, libraries, and compilers in C. Only sometimes they have to turn off the optimizer. The quoted meta-answer is more tired than the original answer. -- -- Norman Diamond, Sony Corporation (diamond@ws.sony.junet) The above opinions are inherited by your machine's init process (pid 1), after being disowned and orphaned. However, if you see this at Waterloo or Anterior, then their administrators must have approved of these opinions.