Path: utzoo!mnetor!tmsoft!dptcdc!jarvis.csri.toronto.edu!ephemeral.ai.toronto.edu!bradb From: bradb@ai.toronto.edu (Brad Brown) Newsgroups: comp.arch Subject: Re: RISC & context switches Message-ID: <89Feb13.125815est.10968@ephemeral.ai.toronto.edu> Date: 13 Feb 89 17:58:05 GMT References: <784@atanasoff.cs.iastate.edu> <7239@june.cs.washington.edu> <89Feb12.125852est.10867@ephemeral.ai.toronto.edu> <792@atanasoff.cs.iastate.edu> Organization: Department of Computer Science, University of Toronto Lines: 36 In article <792@atanasoff.cs.iastate.edu> hascall@atanasoff.cs.iastate.edu (John Hascall) writes: >In article <> bradb@ai.toronto.edu (Brad Brown) writes: >>There is a somewhat related problem when you make a subroutine call -- >>the calling function usually has to save its registers so it gets it's >>"context" restored when the function returns. Machines like MIPS have >>made use of their very large number of registers (192?) by having a pointer >>to one of the registers that is effectively the base pointer for the >>stack of registers that the currently executing function can use. .... > > This was part of my question... I take it, at context switch the MIPS > processor has to save and restore all those registers (at least as > far "up" as the "topmost" register in use--potentially all of them). > Doesn't that mean roughly 400 memory accesses (assuming 192 is correct), > > > What effect (if any) does this have on the suitability of these processors > for "real-time" systems? [As some people have pointed out, I got mixed up between MIPS and SPARC -- my comments above should apply to SPARC...] I think the idea is that in most systems there are a *lot* more function calls than full context switches, which are quite different from the point of view of the amount of work that has to be done. If you can save some time on the function calls then you can afford to waste a little more on the time to save the registers for a full context switch. I don't know whether this would be a big performance hit for real-time systems. Perhaps there are ways of knowing how many registers are actually in use and saving them in a burst. Perhaps there are ways of handling some kinds of real-time events by just allocating a new register window. Perhaps this would work form some "lightweight" inter- rupts, though it's obviously unsuitable for a full context switch. (-: Brad Brown :-) bradb@ai.toronto.edu