Article View: comp.sys.powerpc
Article #3040Re: Debate: PowerMac "trounces" Pentium....???
From: Bob Hauck
Date: Wed, 31 Jan 1996 15:12
Date: Wed, 31 Jan 1996 15:12
50 lines
2755 bytes
2755 bytes
In article <DLzvCC.JMD@artemis.sto.fdata.se>, Fredrik.Pettersson@sto1.wmdata.se writes:
>Dan Pop <danpop@mail.cern.ch> wrote:
>
>[snip]
>
>>Is it? Pray tell, how is MacOS multitasking the following "application":
>
>>main() { for(;;); }
>
>I did one of those on a NT at work and it really shared processor time nicely,
>100% to that process and nothing to the other applications.
>
>So if you write your applications badly they will lock system more or less even
>in a preemtive environment.
>
>Is it my ignorance or could I be right on this point?
Probably ignorance.
On a preemptive system, the endless loop above will get close to
100% of the cpu *if it is the only thing ready to run*. For example,
on my Linux 1.2.13 machine, a single copy of the program gets >90% of
the cpu:
PID USER PRI NI SIZE RES SHRD STAT %CPU %MEM TIME COMMAND
17499 bobh 16 0 8 172 308 R 97.1 0.5 1:00 main
The number _varies_ though, depending on what other processes are
running. Three copies of the program end up each getting 30%:
PID USER PRI NI SIZE RES SHRD STAT %CPU %MEM TIME COMMAND
17499 bobh 30 0 8 172 312 R 32.5 0.5 4:05 main
17513 bobh 30 0 8 172 312 R 32.1 0.5 0:07 main
17514 bobh 30 0 8 172 312 R 32.1 0.5 0:06 main
At no time does the system "lock" or become the least bit non-
responsive. I'm typing this as three copies of the "killer"
program run. Running 100 copies, OTOH, would certainly bog the
system down, as now everything would get 1/100 of the cpu instead
of 1/3.
So, yes, it is still bad form to write apps that busy-wait, even
on a preemptive system. But one or two such apps won't kill the
system.
---
Bob Hauck bobh@wasatch.com
Wasatch Communications Group http://www.wasatch.com
Technical Details
Message-ID:
<4eo0s3$eu8@twin.wasatch.com>Path:
arc1-ca.pugleaf.net!wasatch.com!bobhReferences:
<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> <DLzvCC.JMD@artemis.sto.fdata.se>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wasatch.com!bobh From: bobh@wasatch.com (Bob Hauck) 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: 31 Jan 1996 15:12:03 GMT Organization: Wasatch Communications Group Sender: bobh@hauck_pc.slc.unisysgsg.com (Bob Hauck) Message-ID: <4eo0s3$eu8@twin.wasatch.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> <DLzvCC.JMD@artemis.sto.fdata.se> Reply-To: bobh@wasatch.com NNTP-Posting-Host: hauck_pc.slc.unisysgsg.com