Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!julius.cs.uiuc.edu!rouellet From: rouellet@crhc.uiuc.edu (Roland G. Ouellette) Newsgroups: comp.arch Subject: Re: Let's pretend Message-ID: Date: 18 Dec 90 19:58:19 GMT References: <3042@crdos1.crd.ge.COM> <1990Dec18.082623.16648@kithrup.COM> <1990Dec18.141944.5041@athena.cs.uga.edu> Sender: news@julius.cs.uiuc.edu (USENet News) Organization: University of Illinois Center for Reliable & High Performance Computing Lines: 33 In-Reply-To: is@athena.cs.uga.edu's message of 18 Dec 90 14:19:44 GMT > While more registers sound like motherhood and apple pie, in the > UNIX world they can be a distinct losing proposition. The commonest > service provided by the kernel is a state switch between processes. > The more registers, the longer this state switch must necessarily > take. The only ways out of this require lots more hardware and > discipline from both the compilers and the programmer. In the UNIX world maybe this may be a problem (changing the page table maps in an MP system and figuring out which processes are runnable is probably more of a problem). However your context switch code is likely to involve several procedure calls, each of which may save some registers. By the time the stacks are about to be swapped, most of the user registers will have been flushed out onto the stack of the outgoing process. Only the few that didn't get touched will need saving. The compiler will tell you which ones need to be saved. PLUG: Choices, an OO OS written in an OO language (C++) here at the University of Illinois does this. Vince managed to get g++ (and maybe C Front) to do this for him. [He also complained loudly about hardware enforced context switch instructions which saved every register because his code had less overhead.] This sort of thing might be possible in a UNIX environment, but there's a load of crufty code out there. [I've seen BSD derived code for context switches (from a vendor to remain nameless -- they may have fixed it) which simulated in SW the PCBs used on VAX computers eventhough some of the state was known to be fairly useless on that architecture... like 4 of the 5 stack pointers.] -- = Roland G. Ouellette ouellette@tarkin.enet.dec.com = = 1203 E. Florida Ave rouellet@[dwarfs.]crhc.uiuc.edu = = Urbana, IL 61801 "You rescued me; I didn't want to be saved." = = - Cyndi Lauper =