Article View: comp.sys.powerpc
Article #3014Re: Debate: PowerMac "trounces" Pentium....???
From: Charles Bouldin
Date: Sun, 28 Jan 1996 02:18
Date: Sun, 28 Jan 1996 02:18
40 lines
2883 bytes
2883 bytes
In article <9601272105.AA17852@dxmint.cern.ch>, Dan Pop
<danpop@mail.cern.ch> wrote:
> Is it? Pray tell, how is MacOS multitasking the following "application":
>
> main() { for(;;); }
Well, if the code fragment is in fortran instead of C, you can compile it with
either Language System fortran or Absoft fortran and have the compiler
*automatically* insert the code needed to let an empty loop, or anything
else,
run just fine in the background. I'm more familiar with LSF, what you do with it
is just flip the compiler switch -bkg=3, and the compiler puts context
switching code at the top of every loop. The compiler is set up to give
very precise control over the context switching that occurs
-bkg=0 (give NO time to other processes)
-bkg=1 (give time to other processes every time you hit an i/o statement)
-bkg=2 (same as bkg=1, plus yield time at every subroutine entry)
-bkg=3 (same as bkg=2, plus yield time at the top of every loop)
-bkg=4 (same as bkg=3, plus yield time each time you hit a line with a
statement number)
You can also use compiler directives embedded in your source code to turn
the bkg option up and down in different parts of the code. I'm used that
in data collection code, where I WANT some parts of the code to hog the
whole machine.
In addition, you can set a minimum time that must elapse between task
swaps. That is in there to prevent your code from becoming totally bound
up just looking around all the time to see if other process want time.
Your code fragment of an empty loop would definitely need to use this, or
it would slow down a LOT.
This all makes your point pretty well, I guess! I really *wish* the Mac
had preemptive multitasking, as all the above would just go away. However,
you are mistaken in saying that the Mac cannot handle the case you
suggested. I've used this compiler option with some really huge fortran
codes, things that are hoary old VAX codes from 1980, and they run just
fine in the background. Damn good thing too, as some of them run for a
long time, even on a PowerMac.
Technical Details
Message-ID:
<bouldin-2701962018040001@charlesb.mnsinc.com>Path:
arc1-ca.pugleaf.net!charlesb.mnsinc.com!userReferences:
<4csn1n$klb@macshack.com> <DKxzFK.2r6@eskimo.com> <4d3m6o$bb6@macshack.com> <4d428mINNe14@anaconda.cis.ohio-state.edu> <4d9ui4$e63@macshack.com> <david-1401960302090001@s245_7.resnet.ucla.edu> <1996Jan26.192156@eigb> <jragosta-2601961539320001@ppp-1001.dca.net> <9601272105.AA17852@dxmint.cern.ch>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!charlesb.mnsinc.com!user From: bouldin@enh.nist.gov (Charles Bouldin) Newsgroups: comp.sys.powerpc,comp.os.linux.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.sys.amiga.advocacy,comp.sys.intel Subject: Re: Debate: PowerMac "trounces" Pentium....??? Date: Sat, 27 Jan 1996 20:18:04 -0600 Organization: NIST Message-ID: <bouldin-2701962018040001@charlesb.mnsinc.com> References: <4csn1n$klb@macshack.com> <DKxzFK.2r6@eskimo.com> <4d3m6o$bb6@macshack.com> <4d428mINNe14@anaconda.cis.ohio-state.edu> <4d9ui4$e63@macshack.com> <david-1401960302090001@s245_7.resnet.ucla.edu> <1996Jan26.192156@eigb> <jragosta-2601961539320001@ppp-1001.dca.net> <9601272105.AA17852@dxmint.cern.ch> NNTP-Posting-Host: charlesb.mnsinc.com X-Newsreader: Value-Added NewsWatcher 2.0b24.0+