Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!husc6!encore!zelig!jdarcy From: jdarcy@encore.com (Mostly Useless) Newsgroups: comp.arch Subject: Re: Macintosh OS Message-ID: Date: 9 Jun 90 02:51:29 GMT References: <8767@odin.corp.sgi.com> Sender: news@Encore.COM Lines: 45 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 an amazingly half-baked idea! Oh, sorry. . .I just insulted the bakers of the world. 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. This brings me to my next point, which I would have let slide if I weren't posting already. I've heard a lot from the Mac interface folks saying how "the user is in control". However, long experience with the Mac has taught me that the application can do pretty much what it damn well pleases. It would take me all of two minutes to write a Mac program that will spin in an infinite loop without calling GetNextEvent, forcing the user to reboot. Hell, I'll save them the trouble; I can just as easily write a program that immediately reboots the machine. All of this is of course done without special privileges; the Mac HAS NO IDEA of privileges. With the application in such complete control, I don't see how anyone can say this gives more power to the user. My only guess is that the people saying such things have been fortunate enough to use well-behaved Mac applications and have never lifted a finger in an effort to write one. Take *any* preemptive multitasking system as a counterexample (UNIX, Amiga, VMS, whatever). The user wants to stop a compile or other task, so they do something to tell the OS. The OS turns around and basically yanks the application's cord without so much as a please or thank you. "Sorry, bub. Yer outta here." Thus can even the most ill-behaved applications be tamed. If you ask me - which you didn't - this is the way to keep control in the users' hands. -- Jeff d'Arcy, Generic Software Engineer - jdarcy@encore.com Nothing was ever achieved by accepting reality