Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.arch Subject: Re: Context switch tasks Message-ID: <36507@think.UUCP> Date: 19 Feb 89 03:55:22 GMT References: <788@atanasoff.cs.iastate.edu> <497@pyuxf.UUCP> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 26 In article <497@pyuxf.UUCP> asg@pyuxf.UUCP (alan geller) writes: >My office-mate and I were both curious about these things, so we took >a walk through the scheduler code. After recoiling in disgust, we >rewrote the scheduler (from scratch, mostly in assembler, rather than >the 90% C it was delivered in), and got an enormous (5x to 20x measured) >performance improvement. Why was it necessary to rewrite it in assembler? From your description of the improvements you made, they mostly seemed to be at the algorithm level, not the implementation level. It's true that you used some nice instructions in the implementation of the run queues (which, by the way, seemed alot like the Multics run queues), but you could have done that by writing a small number of assembly subroutines. And it's not clear how important those special instructions actually are to your code; I'm not really familiar with the Vax, but I suspect that their primary benefit is in user code operating on shared memory, because they are indivisible operations. They're probably not a whole lot faster than the corresponding C code. Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar