Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!darkstar!saturn.ucsc.edu!golding From: golding@saturn.ucsc.edu (Richard A. Golding) Newsgroups: comp.arch Subject: Re: Macintosh OS Summary: compiler-operating system cooperation Message-ID: <4242@darkstar.ucsc.edu> Date: 9 Jun 90 05:21:44 GMT References: <8767@odin.corp.sgi.com> Sender: usenet@darkstar.ucsc.edu Organization: University of California, Santa Cruz Lines: 40 In article jdarcy@encore.com (Mostly Useless) writes: >mattly@aldur.sgi.com (James Mattly): >>Consider using >>the pragma() directive in C compilers, (or {$switch+/-} for pascal), to turn >>on or off an automatic placement of GetNextEvent, or some equivalent call >>after every n lines of code. Or inside a loop (not a time critical one!). Or >>inside the basic blocks (for all those compiler fans out there!). This >>would seem to release the programmer from putting a GetNextEvent every so >>often (which seems to be the basis of everyones complaint) and still gain the >>benefits from calling it. > >... What you're talking about is placing an absolutely impossible >task in front of the compiler writers (who certainly have enough to worry >about already) in hopes of making life just a *tiny* bit easier for OS and >application developers. There is NO WAY that the compiler can have any but >the foggiest idea concerning which points are "appropriate" for a possible >context switch. The application designer will certainly have a much better >idea, or the OS can allow the user to choose, but the compiler is absolutely >the worst place to attempt a solution. In fact some recent research has shown just the opposite: that compile- time assistance is a very *good* thing for operating system design. The Emerald system (University of Washington) gets a lot of compiler assistance, and gets significant speedup as a result. More to the point of this newsgroup, the SOAR (Smalltalk on a Risc, UC Berkeley) processor makes assumptions about code behaviour to allow a simpler interrupt and context-switching mechanism. By only performing context switches at method invocations, things got easier (it's been a couple years since I read Ungar's dissertation so the details are a bit hazy.) So I think it's rather hasty to say that compiler assists like this are unreasonable... people are actually doing such things. -richard -- ----------- Richard A. Golding, Crucible (work) and UC Santa Cruz CIS Board (grad student) Internet: golding@cis.ucsc.edu Work: {uunet|ucscc}!cruc!golding Post: Baskin Centre for CE & IS, Appl. Sci. Bldg., UC, Santa Cruz CA 95064