home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume22 / byte-benchmarks / part03 < prev    next >
SHell self-extracting ARchive  |  1990-06-07  |  46.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file Nim source code, ASCII text default (weak)
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 32 32 69 30 33 |Subject:| v22i03|
|00000010| 30 3a 20 20 42 79 74 65 | 20 55 6e 69 78 20 62 65 |0: Byte| Unix be|
|00000020| 6e 63 68 6d 61 72 6b 73 | 2c 20 50 61 72 74 30 33 |nchmarks|, Part03|
|00000030| 2f 30 35 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |/05.News|groups: |
|00000040| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 75 6e 69 |comp.sou|rces.uni|
|00000050| 78 0a 41 70 70 72 6f 76 | 65 64 3a 20 72 73 61 6c |x.Approv|ed: rsal|
|00000060| 7a 40 75 75 6e 65 74 2e | 55 55 2e 4e 45 54 0a 58 |z@uunet.|UU.NET.X|
|00000070| 2d 43 68 65 63 6b 73 75 | 6d 2d 53 6e 65 66 72 75 |-Checksu|m-Snefru|
|00000080| 3a 20 35 39 65 38 30 39 | 61 61 20 37 35 35 61 66 |: 59e809|aa 755af|
|00000090| 61 36 32 20 34 61 38 34 | 62 63 66 34 20 30 65 39 |a62 4a84|bcf4 0e9|
|000000a0| 37 62 32 35 32 0a 0a 53 | 75 62 6d 69 74 74 65 64 |7b252..S|ubmitted|
|000000b0| 2d 62 79 3a 20 22 42 65 | 6e 20 53 6d 69 74 68 20 |-by: "Be|n Smith |
|000000c0| 40 20 42 59 54 45 22 20 | 3c 62 65 6e 40 62 79 74 |@ BYTE" |<ben@byt|
|000000d0| 65 70 62 2e 62 79 74 65 | 2e 63 6f 6d 3e 0a 50 6f |epb.byte|.com>.Po|
|000000e0| 73 74 69 6e 67 2d 6e 75 | 6d 62 65 72 3a 20 56 6f |sting-nu|mber: Vo|
|000000f0| 6c 75 6d 65 20 32 32 2c | 20 49 73 73 75 65 20 33 |lume 22,| Issue 3|
|00000100| 30 0a 41 72 63 68 69 76 | 65 2d 6e 61 6d 65 3a 20 |0.Archiv|e-name: |
|00000110| 62 79 74 65 2d 62 65 6e | 63 68 6d 61 72 6b 73 2f |byte-ben|chmarks/|
|00000120| 70 61 72 74 30 33 0a 0a | 23 21 20 2f 62 69 6e 2f |part03..|#! /bin/|
|00000130| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|00000140| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2e 20 20 52 |hell arc|hive. R|
|00000150| 65 6d 6f 76 65 20 61 6e | 79 74 68 69 6e 67 20 62 |emove an|ything b|
|00000160| 65 66 6f 72 65 20 74 68 | 69 73 20 6c 69 6e 65 2c |efore th|is line,|
|00000170| 20 74 68 65 6e 20 75 6e | 70 61 63 6b 0a 23 20 69 | then un|pack.# i|
|00000180| 74 20 62 79 20 73 61 76 | 69 6e 67 20 69 74 20 69 |t by sav|ing it i|
|00000190| 6e 74 6f 20 61 20 66 69 | 6c 65 20 61 6e 64 20 74 |nto a fi|le and t|
|000001a0| 79 70 69 6e 67 20 22 73 | 68 20 66 69 6c 65 22 2e |yping "s|h file".|
|000001b0| 20 20 54 6f 20 6f 76 65 | 72 77 72 69 74 65 20 65 | To ove|rwrite e|
|000001c0| 78 69 73 74 69 6e 67 0a | 23 20 66 69 6c 65 73 2c |xisting.|# files,|
|000001d0| 20 74 79 70 65 20 22 73 | 68 20 66 69 6c 65 20 2d | type "s|h file -|
|000001e0| 63 22 2e 20 20 59 6f 75 | 20 63 61 6e 20 61 6c 73 |c". You| can als|
|000001f0| 6f 20 66 65 65 64 20 74 | 68 69 73 20 61 73 20 73 |o feed t|his as s|
|00000200| 74 61 6e 64 61 72 64 20 | 69 6e 70 75 74 20 76 69 |tandard |input vi|
|00000210| 61 0a 23 20 75 6e 73 68 | 61 72 2c 20 6f 72 20 62 |a.# unsh|ar, or b|
|00000220| 79 20 74 79 70 69 6e 67 | 20 22 73 68 20 3c 66 69 |y typing| "sh <fi|
|00000230| 6c 65 22 2c 20 65 2e 67 | 2e 2e 20 20 49 66 20 74 |le", e.g|.. If t|
|00000240| 68 69 73 20 61 72 63 68 | 69 76 65 20 69 73 20 63 |his arch|ive is c|
|00000250| 6f 6d 70 6c 65 74 65 2c | 20 79 6f 75 0a 23 20 77 |omplete,| you.# w|
|00000260| 69 6c 6c 20 73 65 65 20 | 74 68 65 20 66 6f 6c 6c |ill see |the foll|
|00000270| 6f 77 69 6e 67 20 6d 65 | 73 73 61 67 65 20 61 74 |owing me|ssage at|
|00000280| 20 74 68 65 20 65 6e 64 | 3a 0a 23 09 09 22 45 6e | the end|:.#.."En|
|00000290| 64 20 6f 66 20 61 72 63 | 68 69 76 65 20 33 20 28 |d of arc|hive 3 (|
|000002a0| 6f 66 20 35 29 2e 22 0a | 23 20 43 6f 6e 74 65 6e |of 5).".|# Conten|
|000002b0| 74 73 3a 20 20 62 65 6e | 63 68 2e 64 6f 63 20 62 |ts: ben|ch.doc b|
|000002c0| 69 67 2e 63 20 64 62 6d | 73 65 72 76 2e 63 0a 23 |ig.c dbm|serv.c.#|
|000002d0| 20 57 72 61 70 70 65 64 | 20 62 79 20 72 73 61 6c | Wrapped| by rsal|
|000002e0| 7a 40 70 61 70 61 79 61 | 2e 62 62 6e 2e 63 6f 6d |z@papaya|.bbn.com|
|000002f0| 20 6f 6e 20 54 75 65 20 | 4d 61 79 20 20 38 20 30 | on Tue |May 8 0|
|00000300| 38 3a 35 35 3a 33 32 20 | 31 39 39 30 0a 50 41 54 |8:55:32 |1990.PAT|
|00000310| 48 3d 2f 62 69 6e 3a 2f | 75 73 72 2f 62 69 6e 3a |H=/bin:/|usr/bin:|
|00000320| 2f 75 73 72 2f 75 63 62 | 20 3b 20 65 78 70 6f 72 |/usr/ucb| ; expor|
|00000330| 74 20 50 41 54 48 0a 69 | 66 20 74 65 73 74 20 2d |t PATH.i|f test -|
|00000340| 66 20 27 62 65 6e 63 68 | 2e 64 6f 63 27 20 2d 61 |f 'bench|.doc' -a|
|00000350| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|00000360| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|00000370| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 63 6c |har: Wil|l not cl|
|00000380| 6f 62 62 65 72 20 65 78 | 69 73 74 69 6e 67 20 66 |obber ex|isting f|
|00000390| 69 6c 65 20 5c 22 27 62 | 65 6e 63 68 2e 64 6f 63 |ile \"'b|ench.doc|
|000003a0| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|000003b0| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|000003c0| 22 27 62 65 6e 63 68 2e | 64 6f 63 27 5c 22 20 5c |"'bench.|doc'\" \|
|000003d0| 28 31 34 36 38 32 20 63 | 68 61 72 61 63 74 65 72 |(14682 c|haracter|
|000003e0| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|000003f0| 20 3e 27 62 65 6e 63 68 | 2e 64 6f 63 27 20 3c 3c | >'bench|.doc' <<|
|00000400| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 40 |'END_OF_|FILE'.X@|
|00000410| 42 54 0a 58 0a 58 5b 54 | 49 54 4c 45 5d 42 59 54 |BT.X.X[T|ITLE]BYT|
|00000420| 45 27 73 20 55 4e 49 58 | 20 42 65 6e 63 68 6d 61 |E's UNIX| Benchma|
|00000430| 72 6b 73 0a 58 5b 44 45 | 4b 5d 53 65 70 61 72 61 |rks.X[DE|K]Separa|
|00000440| 74 69 6e 67 20 66 61 63 | 74 20 66 72 6f 6d 20 66 |ting fac|t from f|
|00000450| 69 63 74 69 6f 6e 20 69 | 6e 20 74 68 65 20 65 78 |iction i|n the ex|
|00000460| 70 6c 6f 64 69 6e 67 20 | 55 4e 49 58 20 65 6d 70 |ploding |UNIX emp|
|00000470| 69 72 65 0a 58 5b 54 4f | 43 5d 42 65 66 6f 72 65 |ire.X[TO|C]Before|
|00000480| 20 79 6f 75 20 6a 75 6d | 70 20 69 6e 74 6f 20 74 | you jum|p into t|
|00000490| 68 65 20 55 4e 49 58 20 | 70 6f 6f 6c 2c 20 73 65 |he UNIX |pool, se|
|000004a0| 65 20 68 6f 77 20 79 6f | 75 72 20 66 61 76 6f 72 |e how yo|ur favor|
|000004b0| 69 74 65 20 73 79 73 74 | 65 6d 20 73 74 61 63 6b |ite syst|em stack|
|000004c0| 73 0a 58 75 70 20 61 67 | 61 69 6e 73 74 20 74 68 |s.Xup ag|ainst th|
|000004d0| 65 20 72 65 73 74 20 6f | 66 20 74 68 65 20 70 61 |e rest o|f the pa|
|000004e0| 63 6b 2e 0a 58 0a 58 42 | 65 6e 20 53 6d 69 74 68 |ck..X.XB|en Smith|
|000004f0| 0a 58 0a 58 49 6e 20 6d | 61 6b 69 6e 67 20 70 75 |.X.XIn m|aking pu|
|00000500| 72 63 68 61 73 65 20 64 | 65 63 69 73 69 6f 6e 73 |rchase d|ecisions|
|00000510| 2c 20 69 74 27 73 20 64 | 69 66 66 69 63 75 6c 74 |, it's d|ifficult|
|00000520| 20 74 6f 20 6b 6e 6f 77 | 20 77 68 6f 6d 20 74 6f | to know| whom to|
|00000530| 20 62 65 6c 69 65 76 65 | 2e 20 45 61 63 68 0a 58 | believe|. Each.X|
|00000540| 76 65 6e 64 6f 72 20 63 | 6c 61 69 6d 73 2c 20 70 |vendor c|laims, p|
|00000550| 72 65 64 69 63 74 61 62 | 6c 79 2c 20 74 68 61 74 |redictab|ly, that|
|00000560| 20 74 68 65 69 72 20 70 | 72 6f 64 75 63 74 73 20 | their p|roducts |
|00000570| 61 72 65 20 62 65 74 74 | 65 72 20 74 68 61 6e 20 |are bett|er than |
|00000580| 74 68 65 0a 58 63 6f 6d | 70 65 74 69 74 69 6f 6e |the.Xcom|petition|
|00000590| 27 73 2c 20 62 75 74 20 | 68 6f 77 20 64 6f 65 73 |'s, but |how does|
|000005a0| 20 6f 6e 65 20 70 72 6f | 76 65 2c 20 6f 72 20 64 | one pro|ve, or d|
|000005b0| 65 62 75 6e 6b 2c 20 74 | 68 65 73 65 20 63 6c 61 |ebunk, t|hese cla|
|000005c0| 69 6d 73 3f 0a 58 20 20 | 43 6f 73 74 20 61 6e 64 |ims?.X |Cost and|
|000005d0| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 74 79 70 | perform|ance typ|
|000005e0| 69 63 61 6c 6c 79 20 74 | 6f 70 20 74 68 65 20 6c |ically t|op the l|
|000005f0| 69 73 74 20 6f 66 20 63 | 6f 6e 73 69 64 65 72 61 |ist of c|onsidera|
|00000600| 74 69 6f 6e 73 20 66 6f | 72 20 74 68 6f 73 65 0a |tions fo|r those.|
|00000610| 58 73 65 65 6b 69 6e 67 | 20 74 6f 20 70 75 72 63 |Xseeking| to purc|
|00000620| 68 61 73 65 20 65 71 75 | 69 70 6d 65 6e 74 2c 20 |hase equ|ipment, |
|00000630| 61 6e 64 20 77 68 69 6c | 65 20 63 6f 73 74 20 63 |and whil|e cost c|
|00000640| 61 6e 20 62 65 20 65 61 | 73 69 6c 79 20 63 6f 6d |an be ea|sily com|
|00000650| 70 61 72 65 64 2c 0a 58 | 70 65 72 66 6f 72 6d 61 |pared,.X|performa|
|00000660| 6e 63 65 20 63 61 6e 6e | 6f 74 2c 20 61 6e 64 20 |nce cann|ot, and |
|00000670| 63 6f 6d 70 61 72 69 6e | 67 20 63 6f 73 74 73 20 |comparin|g costs |
|00000680| 77 69 74 68 6f 75 74 20 | 61 6e 61 6c 79 7a 69 6e |without |analyzin|
|00000690| 67 20 65 61 63 68 20 73 | 79 73 74 65 6d 27 73 0a |g each s|ystem's.|
|000006a0| 58 72 65 6c 61 74 69 76 | 65 20 76 61 6c 75 65 20 |Xrelativ|e value |
|000006b0| 69 73 20 61 20 77 6f 72 | 74 68 6c 65 73 73 20 65 |is a wor|thless e|
|000006c0| 78 65 72 63 69 73 65 2e | 0a 58 20 20 57 68 65 6e |xercise.|.X When|
|000006d0| 20 44 4f 53 20 62 65 63 | 61 6d 65 20 70 6f 70 75 | DOS bec|ame popu|
|000006e0| 6c 61 72 2c 20 69 74 20 | 61 6c 6c 6f 77 65 64 20 |lar, it |allowed |
|000006f0| 66 6f 72 20 74 68 65 20 | 64 65 76 65 6c 6f 70 6d |for the |developm|
|00000700| 65 6e 74 20 6f 66 20 70 | 65 72 66 6f 72 6d 61 6e |ent of p|erforman|
|00000710| 63 65 0a 58 6d 65 61 73 | 75 72 65 6d 65 6e 74 20 |ce.Xmeas|urement |
|00000720| 70 72 6f 67 72 61 6d 73 | 2c 20 62 65 6e 63 68 6d |programs|, benchm|
|00000730| 61 72 6b 73 2c 20 74 68 | 61 74 20 77 6f 75 6c 64 |arks, th|at would|
|00000740| 20 72 75 6e 20 6f 6e 20 | 61 6e 79 20 73 79 73 74 | run on |any syst|
|00000750| 65 6d 20 74 68 61 74 20 | 72 61 6e 20 44 4f 53 2e |em that |ran DOS.|
|00000760| 0a 58 42 59 54 45 27 73 | 20 6c 61 62 20 74 65 63 |.XBYTE's| lab tec|
|00000770| 68 6e 69 63 69 61 6e 73 | 20 73 65 74 20 61 62 6f |hnicians| set abo|
|00000780| 75 74 20 63 72 65 61 74 | 69 6e 67 20 74 68 65 69 |ut creat|ing thei|
|00000790| 72 20 6f 77 6e 2c 20 61 | 6e 64 20 74 68 65 20 42 |r own, a|nd the B|
|000007a0| 59 54 45 20 44 4f 53 0a | 58 62 65 6e 63 68 6d 61 |YTE DOS.|Xbenchma|
|000007b0| 72 6b 73 20 77 65 72 65 | 20 62 6f 72 6e 2e 20 44 |rks were| born. D|
|000007c0| 6f 7a 65 6e 73 20 6f 66 | 20 73 79 73 74 65 6d 73 |ozens of| systems|
|000007d0| 20 68 61 76 65 20 62 65 | 65 6e 20 63 6c 6f 63 6b | have be|en clock|
|000007e0| 65 64 20 75 73 69 6e 67 | 20 74 68 65 73 65 0a 58 |ed using| these.X|
|000007f0| 66 61 63 69 6c 69 74 69 | 65 73 2c 20 61 6e 64 20 |faciliti|es, and |
|00000800| 65 61 63 68 20 72 65 76 | 69 65 77 20 6f 66 20 61 |each rev|iew of a|
|00000810| 20 6e 65 77 20 44 4f 53 | 2d 62 61 73 65 64 20 73 | new DOS|-based s|
|00000820| 79 73 74 65 6d 20 69 6e | 63 6c 75 64 65 73 20 74 |ystem in|cludes t|
|00000830| 68 65 20 72 65 73 75 6c | 74 73 20 6f 66 0a 58 74 |he resul|ts of.Xt|
|00000840| 68 65 73 65 20 62 65 6e | 63 68 6d 61 72 6b 73 2e |hese ben|chmarks.|
|00000850| 0a 58 20 20 54 68 69 73 | 20 69 73 20 61 6c 6c 20 |.X This| is all |
|00000860| 76 65 72 79 20 77 65 6c | 6c 2c 20 62 75 74 20 77 |very wel|l, but w|
|00000870| 68 69 6c 65 20 44 4f 53 | 20 69 73 20 69 6e 73 74 |hile DOS| is inst|
|00000880| 61 6c 6c 65 64 20 6f 6e | 20 61 20 67 72 65 61 74 |alled on| a great|
|00000890| 20 6d 61 6e 79 20 73 79 | 73 74 65 6d 73 2c 0a 58 | many sy|stems,.X|
|000008a0| 69 74 20 69 73 20 6e 6f | 20 6c 6f 6e 67 65 72 20 |it is no| longer |
|000008b0| 74 68 65 20 21 49 54 41 | 4c 21 6f 6e 6c 79 21 45 |the !ITA|L!only!E|
|000008c0| 4e 44 49 54 41 4c 21 20 | 70 6f 70 75 6c 61 72 20 |NDITAL! |popular |
|000008d0| 6d 75 6c 74 69 2d 70 6c | 61 74 66 6f 72 6d 20 6f |multi-pl|atform o|
|000008e0| 70 65 72 61 74 69 6e 67 | 0a 58 73 79 73 74 65 6d |perating|.Xsystem|
|000008f0| 2e 20 55 73 65 72 20 64 | 65 6d 61 6e 64 73 20 66 |. User d|emands f|
|00000900| 6f 72 20 67 72 65 61 74 | 65 72 20 65 78 70 61 6e |or great|er expan|
|00000910| 64 61 62 69 6c 69 74 79 | 2c 20 62 65 74 74 65 72 |dability|, better|
|00000920| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 61 6e 64 | perform|ance and|
|00000930| 0a 58 6d 75 6c 74 69 2d | 74 61 73 6b 69 6e 67 20 |.Xmulti-|tasking |
|00000940| 68 61 76 65 20 74 75 72 | 6e 65 64 20 55 4e 49 58 |have tur|ned UNIX|
|00000950| 20 73 79 73 74 65 6d 73 | 20 69 6e 74 6f 20 6f 6e | systems| into on|
|00000960| 65 20 6f 66 20 74 68 65 | 20 66 61 73 74 65 73 74 |e of the| fastest|
|00000970| 20 67 72 6f 77 69 6e 67 | 0a 58 73 65 67 6d 65 6e | growing|.Xsegmen|
|00000980| 74 73 20 6f 66 20 74 68 | 65 20 6d 61 72 6b 65 74 |ts of th|e market|
|00000990| 2e 20 57 68 65 6e 20 55 | 4e 49 58 20 73 74 65 70 |. When U|NIX step|
|000009a0| 70 65 64 20 66 72 6f 6d | 20 6d 69 6e 69 63 6f 6d |ped from| minicom|
|000009b0| 70 75 74 65 72 73 20 74 | 6f 20 77 6f 72 6b 73 74 |puters t|o workst|
|000009c0| 61 74 69 6f 6e 73 2c 0a | 58 69 74 20 65 73 74 61 |ations,.|Xit esta|
|000009d0| 62 6c 69 73 68 65 64 20 | 69 74 73 65 6c 66 20 61 |blished |itself a|
|000009e0| 73 20 74 68 65 20 64 65 | 66 61 63 74 6f 20 4f 53 |s the de|facto OS|
|000009f0| 20 66 6f 72 20 61 6e 20 | 65 78 63 69 74 69 6e 67 | for an |exciting|
|00000a00| 20 6e 65 77 20 62 72 65 | 65 64 20 6f 66 20 6d 61 | new bre|ed of ma|
|00000a10| 63 68 69 6e 65 2e 0a 58 | 4e 6f 77 2c 20 77 69 74 |chine..X|Now, wit|
|00000a20| 68 20 73 6f 6c 69 64 20 | 69 6d 70 6c 65 6d 65 6e |h solid |implemen|
|00000a30| 74 61 74 69 6f 6e 73 20 | 66 6f 72 20 61 66 66 6f |tations |for affo|
|00000a40| 72 64 61 62 6c 65 20 49 | 6e 74 65 6c 20 61 6e 64 |rdable I|ntel and|
|00000a50| 20 4d 6f 74 6f 72 6f 6c | 61 2d 62 61 73 65 64 0a | Motorol|a-based.|
|00000a60| 58 70 6c 61 74 66 6f 72 | 6d 73 2c 20 55 4e 49 58 |Xplatfor|ms, UNIX|
|00000a70| 20 69 73 20 6d 61 6b 69 | 6e 67 20 61 20 6e 61 6d | is maki|ng a nam|
|00000a80| 65 20 66 6f 72 20 69 74 | 73 65 6c 66 20 69 6e 20 |e for it|self in |
|00000a90| 74 68 65 20 50 43 20 72 | 65 61 6c 6d 2e 20 41 73 |the PC r|ealm. As|
|00000aa0| 20 55 4e 49 58 20 66 69 | 6e 64 73 0a 58 69 74 73 | UNIX fi|nds.Xits|
|00000ab0| 20 77 61 79 20 69 6e 74 | 6f 20 74 68 65 20 6d 61 | way int|o the ma|
|00000ac0| 69 6e 73 74 72 65 61 6d | 2c 20 69 74 20 69 73 20 |instream|, it is |
|00000ad0| 6e 65 63 65 73 73 61 72 | 79 20 74 6f 20 68 61 76 |necessar|y to hav|
|00000ae0| 65 20 74 68 65 20 74 6f | 6f 6c 73 20 74 6f 20 6f |e the to|ols to o|
|00000af0| 62 6a 65 63 74 69 76 65 | 6c 79 0a 58 6d 65 61 73 |bjective|ly.Xmeas|
|00000b00| 75 72 65 20 6e 6f 74 20 | 6f 6e 6c 79 20 74 68 65 |ure not |only the|
|00000b10| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 6f 66 20 | perform|ance of |
|00000b20| 76 61 72 69 6f 75 73 20 | 68 61 72 64 77 61 72 65 |various |hardware|
|00000b30| 20 70 6c 61 74 66 6f 72 | 6d 73 2c 20 62 75 74 20 | platfor|ms, but |
|00000b40| 6f 66 0a 58 64 69 66 66 | 65 72 65 6e 74 20 76 65 |of.Xdiff|erent ve|
|00000b50| 72 73 69 6f 6e 73 20 6f | 66 20 55 4e 49 58 20 61 |rsions o|f UNIX a|
|00000b60| 73 20 77 65 6c 6c 2e 0a | 58 0a 58 21 53 55 42 48 |s well..|X.X!SUBH|
|00000b70| 45 44 21 55 6e 69 78 20 | 69 73 20 4e 6f 74 20 4d |ED!Unix |is Not M|
|00000b80| 53 2d 44 4f 53 21 45 4e | 44 53 55 42 48 45 44 21 |S-DOS!EN|DSUBHED!|
|00000b90| 0a 58 43 6f 6e 63 65 70 | 74 75 61 6c 6c 79 2c 20 |.XConcep|tually, |
|00000ba0| 42 59 54 45 27 73 20 55 | 4e 49 58 20 62 65 6e 63 |BYTE's U|NIX benc|
|00000bb0| 68 6d 61 72 6b 73 20 61 | 72 65 20 74 68 65 20 73 |hmarks a|re the s|
|00000bc0| 61 6d 65 20 61 73 20 42 | 59 54 45 27 73 20 4d 53 |ame as B|YTE's MS|
|00000bd0| 2d 44 4f 53 0a 58 62 65 | 6e 63 68 6d 61 72 6b 73 |-DOS.Xbe|nchmarks|
|00000be0| 3a 20 57 65 20 68 61 76 | 65 20 63 6f 6d 62 69 6e |: We hav|e combin|
|00000bf0| 65 64 20 65 76 61 6c 75 | 61 74 69 6f 6e 20 6f 66 |ed evalu|ation of|
|00000c00| 20 62 6f 74 68 20 6c 6f | 77 2d 6c 65 76 65 6c 20 | both lo|w-level |
|00000c10| 6f 70 65 72 61 74 69 6f | 6e 73 20 61 6e 64 0a 58 |operatio|ns and.X|
|00000c20| 68 69 67 68 2d 6c 65 76 | 65 6c 20 61 70 70 6c 69 |high-lev|el appli|
|00000c30| 63 61 74 69 6f 6e 73 20 | 74 79 70 65 20 70 72 6f |cations |type pro|
|00000c40| 67 72 61 6d 73 20 74 6f | 20 68 69 67 68 6c 69 67 |grams to| highlig|
|00000c50| 68 74 20 74 68 65 20 70 | 65 72 66 6f 72 6d 61 6e |ht the p|erforman|
|00000c60| 63 65 20 6f 66 20 74 68 | 65 0a 58 65 6e 74 69 72 |ce of th|e.Xentir|
|00000c70| 65 20 73 79 73 74 65 6d | 2e 0a 58 20 20 42 75 74 |e system|..X But|
|00000c80| 20 55 4e 49 58 20 69 73 | 20 63 6f 6e 73 69 64 65 | UNIX is| conside|
|00000c90| 72 61 62 6c 79 20 64 69 | 66 66 65 72 65 6e 74 20 |rably di|fferent |
|00000ca0| 66 72 6f 6d 20 4d 53 2d | 44 4f 53 2e 20 49 6e 20 |from MS-|DOS. In |
|00000cb0| 74 68 65 20 66 69 72 73 | 74 20 70 6c 61 63 65 2c |the firs|t place,|
|00000cc0| 20 69 74 20 69 73 20 61 | 0a 58 21 49 54 41 4c 21 | it is a|.X!ITAL!|
|00000cd0| 6d 75 6c 74 69 21 45 4e | 44 49 54 41 4c 21 2d 74 |multi!EN|DITAL!-t|
|00000ce0| 61 73 6b 69 6e 67 2c 20 | 21 49 54 41 4c 21 6d 75 |asking, |!ITAL!mu|
|00000cf0| 6c 74 69 21 45 4e 44 49 | 54 41 4c 21 2d 75 73 65 |lti!ENDI|TAL!-use|
|00000d00| 72 20 6f 70 65 72 61 74 | 69 6e 67 20 73 79 73 74 |r operat|ing syst|
|00000d10| 65 6d 2e 20 49 74 0a 58 | 69 73 20 61 6c 73 6f 20 |em. It.X|is also |
|00000d20| 70 6f 72 74 61 62 6c 65 | 2c 20 61 62 6c 65 20 74 |portable|, able t|
|00000d30| 6f 20 72 75 6e 20 6f 6e | 20 6d 61 6e 79 20 64 69 |o run on| many di|
|00000d40| 66 66 65 72 65 6e 74 20 | 6b 69 6e 64 73 20 6f 66 |fferent |kinds of|
|00000d50| 20 63 6f 6d 70 75 74 65 | 72 73 2e 20 4d 53 2d 44 | compute|rs. MS-D|
|00000d60| 4f 53 20 69 73 0a 58 61 | 20 21 49 54 41 4c 21 73 |OS is.Xa| !ITAL!s|
|00000d70| 69 6e 67 6c 65 21 45 4e | 44 49 54 41 4c 21 2d 74 |ingle!EN|DITAL!-t|
|00000d80| 61 73 6b 69 6e 67 2c 20 | 21 49 54 41 4c 21 73 69 |asking, |!ITAL!si|
|00000d90| 6e 67 6c 65 21 45 4e 44 | 49 54 41 4c 21 2d 75 73 |ngle!END|ITAL!-us|
|00000da0| 65 72 20 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |er opera|ting sys|
|00000db0| 74 65 6d 2c 0a 58 61 6e | 64 20 69 74 20 69 73 20 |tem,.Xan|d it is |
|00000dc0| 69 6e 74 65 6e 64 65 64 | 20 74 6f 20 72 75 6e 20 |intended| to run |
|00000dd0| 6f 6e 20 65 73 73 65 6e | 74 69 61 6c 6c 79 20 6f |on essen|tially o|
|00000de0| 6e 65 20 6b 69 6e 64 20 | 6f 66 20 63 6f 6d 70 75 |ne kind |of compu|
|00000df0| 74 65 72 2c 20 61 6e 20 | 49 42 4d 2d 50 43 20 6f |ter, an |IBM-PC o|
|00000e00| 72 0a 58 50 43 20 60 60 | 63 6c 6f 6e 65 2c 27 27 |r.XPC ``|clone,''|
|00000e10| 20 75 74 69 6c 69 7a 69 | 6e 67 20 61 20 73 70 65 | utilizi|ng a spe|
|00000e20| 63 69 66 69 63 20 63 6c | 61 73 73 20 6f 66 20 70 |cific cl|ass of p|
|00000e30| 72 6f 63 65 73 73 6f 72 | 20 66 72 6f 6d 20 49 6e |rocessor| from In|
|00000e40| 74 65 6c 2e 20 41 73 20 | 61 0a 58 72 65 73 75 6c |tel. As |a.Xresul|
|00000e50| 74 2c 20 74 68 65 20 55 | 4e 49 58 20 62 65 6e 63 |t, the U|NIX benc|
|00000e60| 68 6d 61 72 6b 73 20 64 | 69 66 66 65 72 20 66 72 |hmarks d|iffer fr|
|00000e70| 6f 6d 20 74 68 65 69 72 | 20 4d 53 2d 44 4f 53 20 |om their| MS-DOS |
|00000e80| 63 6f 75 6e 74 65 72 70 | 61 72 74 73 2e 20 45 76 |counterp|arts. Ev|
|00000e90| 65 6e 0a 58 74 68 6f 75 | 67 68 20 74 68 65 72 65 |en.Xthou|gh there|
|00000ea0| 20 61 72 65 20 73 6f 6d | 65 20 65 71 75 69 76 61 | are som|e equiva|
|00000eb0| 6c 65 6e 74 20 6c 6f 77 | 2d 6c 65 76 65 6c 20 74 |lent low|-level t|
|00000ec0| 65 73 74 73 2c 20 79 6f | 75 20 77 69 6c 6c 20 66 |ests, yo|u will f|
|00000ed0| 69 6e 64 20 74 68 61 74 | 20 65 76 65 6e 0a 58 74 |ind that| even.Xt|
|00000ee0| 68 65 73 65 20 72 75 6e | 20 64 69 66 66 65 72 65 |hese run| differe|
|00000ef0| 6e 74 6c 79 3b 20 74 68 | 65 20 70 6f 70 75 6c 61 |ntly; th|e popula|
|00000f00| 72 20 44 68 72 79 73 74 | 6f 6e 65 20 62 65 6e 63 |r Dhryst|one benc|
|00000f10| 68 6d 61 72 6b 20 63 6f | 6d 6d 6f 6e 6c 79 20 67 |hmark co|mmonly g|
|00000f20| 69 76 65 73 0a 58 64 69 | 66 66 65 72 65 6e 74 20 |ives.Xdi|fferent |
|00000f30| 72 65 73 75 6c 74 73 2c | 20 6f 6e 20 74 68 65 20 |results,| on the |
|00000f40| 73 61 6d 65 20 68 61 72 | 64 77 61 72 65 2c 20 77 |same har|dware, w|
|00000f50| 68 65 6e 20 72 75 6e 20 | 75 6e 64 65 72 20 62 6f |hen run |under bo|
|00000f60| 74 68 20 44 4f 53 20 61 | 6e 64 20 55 4e 49 58 2e |th DOS a|nd UNIX.|
|00000f70| 0a 58 54 68 65 20 72 65 | 61 73 6f 6e 3f 20 44 69 |.XThe re|ason? Di|
|00000f80| 66 66 65 72 65 6e 74 20 | 63 6f 6d 70 69 6c 65 72 |fferent |compiler|
|00000f90| 73 20 61 72 65 20 62 65 | 69 6e 67 20 75 73 65 64 |s are be|ing used|
|00000fa0| 2c 20 61 6e 64 20 74 68 | 65 20 75 6e 64 65 72 6c |, and th|e underl|
|00000fb0| 79 69 6e 67 20 6f 70 65 | 72 61 74 69 6e 67 0a 58 |ying ope|rating.X|
|00000fc0| 73 79 73 74 65 6d 73 20 | 61 6e 64 20 73 65 72 76 |systems |and serv|
|00000fd0| 69 63 65 73 20 61 72 65 | 20 77 69 6c 64 6c 79 20 |ices are| wildly |
|00000fe0| 64 69 66 66 65 72 65 6e | 74 2e 0a 58 20 20 41 6e |differen|t..X An|
|00000ff0| 6f 74 68 65 72 20 69 6d | 70 6f 72 74 61 6e 74 20 |other im|portant |
|00001000| 64 69 66 66 65 72 65 6e | 63 65 20 69 73 20 74 68 |differen|ce is th|
|00001010| 61 74 20 4d 69 63 72 6f | 73 6f 66 74 20 69 73 20 |at Micro|soft is |
|00001020| 74 68 65 20 6f 6e 6c 79 | 20 72 65 61 6c 20 73 6f |the only| real so|
|00001030| 75 72 63 65 20 6f 66 0a | 58 44 4f 53 3b 20 6f 74 |urce of.|XDOS; ot|
|00001040| 68 65 72 20 73 75 70 70 | 6c 69 65 72 73 20 73 69 |her supp|liers si|
|00001050| 6d 70 6c 79 20 72 65 70 | 61 63 6b 61 67 65 20 4d |mply rep|ackage M|
|00001060| 69 63 72 6f 73 6f 66 74 | 27 73 20 62 61 73 69 63 |icrosoft|'s basic|
|00001070| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste|
|00001080| 6d 0a 58 75 6e 64 65 72 | 20 6f 74 68 65 72 20 6e |m.Xunder| other n|
|00001090| 61 6d 65 73 2e 20 49 6e | 20 63 6f 6e 74 72 61 73 |ames. In| contras|
|000010a0| 74 2c 20 74 68 65 72 65 | 20 61 72 65 20 6d 61 6e |t, there| are man|
|000010b0| 79 20 64 69 66 66 65 72 | 65 6e 74 20 6b 69 6e 64 |y differ|ent kind|
|000010c0| 73 20 6f 66 20 55 4e 49 | 58 2c 20 61 6e 64 0a 58 |s of UNI|X, and.X|
|000010d0| 77 68 69 6c 65 20 73 69 | 6d 69 6c 61 72 69 74 69 |while si|milariti|
|000010e0| 65 73 20 65 78 69 73 74 | 20 28 74 68 65 20 63 6f |es exist| (the co|
|000010f0| 72 65 20 55 4e 49 58 20 | 66 72 6f 6d 20 44 65 6c |re UNIX |from Del|
|00001100| 6c 2c 20 45 76 65 72 65 | 78 20 61 6e 64 20 49 6e |l, Evere|x and In|
|00001110| 74 65 72 61 63 74 69 76 | 65 0a 58 53 79 73 74 65 |teractiv|e.XSyste|
|00001120| 6d 73 20 61 72 65 20 76 | 69 72 74 75 61 6c 6c 79 |ms are v|irtually|
|00001130| 20 74 68 65 20 73 61 6d | 65 29 2c 20 74 68 65 72 | the sam|e), ther|
|00001140| 65 20 61 72 65 20 55 4e | 49 58 20 61 6e 64 20 55 |e are UN|IX and U|
|00001150| 4e 49 58 2d 6c 69 6b 65 | 20 6f 70 65 72 61 74 69 |NIX-like| operati|
|00001160| 6e 67 0a 58 73 79 73 74 | 65 6d 73 20 74 68 61 74 |ng.Xsyst|ems that|
|00001170| 20 64 69 66 66 65 72 20 | 67 72 65 61 74 6c 79 20 | differ |greatly |
|00001180| 66 72 6f 6d 20 6f 6e 65 | 20 61 6e 6f 74 68 65 72 |from one| another|
|00001190| 2e 20 43 6f 6e 63 6c 75 | 73 69 6f 6e 3a 20 54 68 |. Conclu|sion: Th|
|000011a0| 65 20 55 4e 49 58 20 62 | 65 6e 63 68 6d 61 72 6b |e UNIX b|enchmark|
|000011b0| 73 0a 58 61 72 65 20 65 | 76 61 6c 75 61 74 69 6e |s.Xare e|valuatin|
|000011c0| 67 20 74 68 65 20 69 6d | 70 6c 65 6d 65 6e 74 61 |g the im|plementa|
|000011d0| 74 69 6f 6e 20 6f 66 20 | 55 4e 49 58 20 61 6e 64 |tion of |UNIX and|
|000011e0| 20 74 68 65 20 72 65 73 | 69 64 65 6e 74 20 63 6f | the res|ident co|
|000011f0| 6d 70 69 6c 65 72 20 61 | 73 20 77 65 6c 6c 0a 58 |mpiler a|s well.X|
|00001200| 61 73 20 74 68 65 20 68 | 61 72 64 77 61 72 65 20 |as the h|ardware |
|00001210| 6f 6e 20 77 68 69 63 68 | 20 69 74 20 69 73 20 72 |on which| it is r|
|00001220| 75 6e 6e 69 6e 67 20 28 | 74 68 65 20 4d 53 2d 44 |unning (|the MS-D|
|00001230| 4f 53 20 61 6e 64 20 41 | 70 70 6c 65 20 4d 61 63 |OS and A|pple Mac|
|00001240| 69 6e 74 6f 73 68 0a 58 | 62 65 6e 63 68 6d 61 72 |intosh.X|benchmar|
|00001250| 6b 73 20 75 73 65 20 61 | 20 63 6f 6d 6d 6f 6e 20 |ks use a| common |
|00001260| 63 6f 6d 70 69 6c 65 72 | 2c 20 74 68 65 20 70 75 |compiler|, the pu|
|00001270| 62 6c 69 63 2d 64 6f 6d | 61 69 6e 20 53 6d 61 6c |blic-dom|ain Smal|
|00001280| 6c 20 43 29 2e 0a 58 20 | 20 57 69 74 68 20 73 6f |l C)..X | With so|
|00001290| 20 6d 61 6e 79 20 76 61 | 72 69 61 62 6c 65 73 2c | many va|riables,|
|000012a0| 20 77 68 61 74 20 69 73 | 20 63 6f 6e 73 74 61 6e | what is| constan|
|000012b0| 74 3f 20 57 65 6c 6c 2c | 20 77 65 20 68 61 76 65 |t? Well,| we have|
|000012c0| 20 65 73 74 61 62 6c 69 | 73 68 65 64 20 61 0a 58 | establi|shed a.X|
|000012d0| 62 61 73 65 6c 69 6e 65 | 2c 20 53 43 4f 20 58 65 |baseline|, SCO Xe|
|000012e0| 6e 69 78 20 33 38 36 20 | 76 65 72 73 69 6f 6e 20 |nix 386 |version |
|000012f0| 32 2e 33 2e 31 2e 20 72 | 75 6e 6e 69 6e 67 20 6f |2.3.1. r|unning o|
|00001300| 6e 20 74 68 65 20 45 76 | 65 72 65 78 20 33 38 36 |n the Ev|erex 386|
|00001310| 2f 33 33 20 77 69 74 68 | 20 34 0a 58 4d 62 79 74 |/33 with| 4.XMbyt|
|00001320| 65 73 20 6f 66 20 52 41 | 4d 20 61 6e 64 20 61 6e |es of RA|M and an|
|00001330| 20 38 30 33 38 37 20 6d | 61 74 68 20 63 6f 70 72 | 80387 m|ath copr|
|00001340| 6f 63 65 73 73 6f 72 2e | 20 57 68 69 6c 65 20 69 |ocessor.| While i|
|00001350| 74 20 69 73 6e 27 74 20 | 55 4e 49 58 20 70 65 72 |t isn't |UNIX per|
|00001360| 20 73 65 0a 58 28 62 65 | 63 61 75 73 65 20 41 54 | se.X(be|cause AT|
|00001370| 26 54 20 64 65 63 69 64 | 65 73 20 77 68 69 63 68 |&T decid|es which|
|00001380| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 73 | impleme|ntations|
|00001390| 20 6d 61 79 20 62 65 20 | 63 61 6c 6c 65 64 20 60 | may be |called `|
|000013a0| 60 55 4e 49 58 27 27 29 | 2c 20 69 74 20 69 73 0a |`UNIX'')|, it is.|
|000013b0| 58 6d 6f 72 65 20 70 6f | 70 75 6c 61 72 20 74 68 |Xmore po|pular th|
|000013c0| 61 6e 20 61 6e 79 20 6f | 74 68 65 72 20 50 43 20 |an any o|ther PC |
|000013d0| 55 4e 49 58 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |UNIX imp|lementat|
|000013e0| 69 6f 6e 2e 20 49 74 20 | 69 73 20 73 70 65 63 69 |ion. It |is speci|
|000013f0| 66 69 63 61 6c 6c 79 0a | 58 64 65 73 69 67 6e 65 |fically.|Xdesigne|
|00001400| 64 20 66 6f 72 20 38 30 | 33 38 36 2d 62 61 73 65 |d for 80|386-base|
|00001410| 64 20 63 6f 6d 70 75 74 | 65 72 73 20 77 69 74 68 |d comput|ers with|
|00001420| 20 66 75 6c 6c 20 33 32 | 20 62 69 74 20 6d 65 6d | full 32| bit mem|
|00001430| 6f 72 79 20 61 63 63 65 | 73 73 2e 20 54 68 65 20 |ory acce|ss. The |
|00001440| 45 76 65 72 65 78 0a 58 | 33 38 36 2f 33 33 20 77 |Everex.X|386/33 w|
|00001450| 61 73 20 63 68 6f 73 65 | 6e 20 62 65 63 61 75 73 |as chose|n becaus|
|00001460| 65 20 69 74 20 69 73 20 | 6f 6e 65 20 6f 66 20 74 |e it is |one of t|
|00001470| 6f 64 61 79 27 73 20 68 | 69 67 68 65 73 74 20 70 |oday's h|ighest p|
|00001480| 65 72 66 6f 72 6d 61 6e | 63 65 20 33 38 36 0a 58 |erforman|ce 386.X|
|00001490| 63 6f 6d 70 75 74 65 72 | 73 20 70 72 6f 70 65 72 |computer|s proper|
|000014a0| 6c 79 20 63 6f 6e 66 69 | 67 75 72 65 64 20 74 6f |ly confi|gured to|
|000014b0| 20 72 75 6e 20 74 68 65 | 20 66 75 6c 6c 20 33 32 | run the| full 32|
|000014c0| 20 62 69 74 20 6f 70 65 | 72 61 74 69 6e 67 20 73 | bit ope|rating s|
|000014d0| 79 73 74 65 6d 2e 20 28 | 53 6f 6d 65 0a 58 33 38 |ystem. (|Some.X38|
|000014e0| 36 20 63 6f 6d 70 75 74 | 65 72 73 20 63 61 6e 6e |6 comput|ers cann|
|000014f0| 6f 74 20 61 63 63 65 73 | 73 20 6d 65 6d 6f 72 79 |ot acces|s memory|
|00001500| 20 74 68 72 6f 75 67 68 | 20 73 69 6e 67 6c 65 20 | through| single |
|00001510| 33 32 20 62 69 74 20 6f | 70 65 72 61 74 69 6f 6e |32 bit o|peration|
|00001520| 73 3b 20 73 6d 61 6c 6c | 0a 58 6d 61 74 74 65 72 |s; small|.Xmatter|
|00001530| 20 69 66 20 79 6f 75 20 | 61 72 65 20 6a 75 73 74 | if you |are just|
|00001540| 20 72 75 6e 6e 69 6e 67 | 20 4d 53 2d 44 4f 53 2c | running| MS-DOS,|
|00001550| 20 61 6e 20 38 20 62 69 | 74 20 6f 70 65 72 61 74 | an 8 bi|t operat|
|00001560| 69 6e 67 20 73 79 73 74 | 65 6d 2c 20 62 75 74 20 |ing syst|em, but |
|00001570| 73 65 72 69 6f 75 73 0a | 58 69 66 20 79 6f 75 20 |serious.|Xif you |
|00001580| 77 61 6e 74 20 74 6f 20 | 72 75 6e 20 55 4e 49 58 |want to |run UNIX|
|00001590| 2e 29 20 54 68 69 73 20 | 63 6f 6d 62 69 6e 61 74 |.) This |combinat|
|000015a0| 69 6f 6e 20 6f 66 20 73 | 79 73 74 65 6d 20 61 6e |ion of s|ystem an|
|000015b0| 64 20 4f 53 20 69 73 20 | 74 69 6d 65 6c 79 2c 20 |d OS is |timely, |
|000015c0| 62 75 74 0a 58 77 65 27 | 6c 6c 20 63 6f 6e 74 69 |but.Xwe'|ll conti|
|000015d0| 6e 75 65 20 74 6f 20 61 | 64 6a 75 73 74 20 74 68 |nue to a|djust th|
|000015e0| 65 20 62 61 73 65 6c 69 | 6e 65 20 61 73 20 6e 65 |e baseli|ne as ne|
|000015f0| 65 64 65 64 20 74 6f 20 | 72 65 66 6c 65 63 74 20 |eded to |reflect |
|00001600| 74 68 65 20 69 6e 73 74 | 61 6c 6c 65 64 20 50 43 |the inst|alled PC|
|00001610| 0a 58 61 6e 64 20 77 6f | 72 6b 73 74 61 74 69 6f |.Xand wo|rkstatio|
|00001620| 6e 20 55 4e 49 58 20 62 | 61 73 65 2e 0a 58 0a 58 |n UNIX b|ase..X.X|
|00001630| 21 53 55 42 48 45 44 21 | 54 68 65 20 4c 6f 77 20 |!SUBHED!|The Low |
|00001640| 4c 65 76 65 6c 20 42 65 | 6e 63 68 20 50 72 6f 67 |Level Be|nch Prog|
|00001650| 72 61 6d 73 21 45 4e 44 | 53 55 42 48 45 44 21 0a |rams!END|SUBHED!.|
|00001660| 58 54 68 65 20 42 59 54 | 45 20 55 4e 49 58 20 62 |XThe BYT|E UNIX b|
|00001670| 65 6e 63 68 6d 61 72 6b | 73 20 63 6f 6e 73 69 73 |enchmark|s consis|
|00001680| 74 20 6f 66 20 65 69 67 | 68 74 20 67 72 6f 75 70 |t of eig|ht group|
|00001690| 73 20 6f 66 20 70 72 6f | 67 72 61 6d 73 3a 20 61 |s of pro|grams: a|
|000016a0| 72 69 74 68 6d 65 74 69 | 63 2c 0a 58 73 79 73 74 |rithmeti|c,.Xsyst|
|000016b0| 65 6d 20 63 61 6c 6c 73 | 2c 20 6d 65 6d 6f 72 79 |em calls|, memory|
|000016c0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 2c 20 64 69 73 | operati|ons, dis|
|000016d0| 6b 20 6f 70 65 72 61 74 | 69 6f 6e 73 2c 20 64 68 |k operat|ions, dh|
|000016e0| 72 79 73 74 6f 6e 65 2c | 20 64 61 74 61 62 61 73 |rystone,| databas|
|000016f0| 65 0a 58 6f 70 65 72 61 | 74 69 6f 6e 73 2c 20 73 |e.Xopera|tions, s|
|00001700| 79 73 74 65 6d 20 6c 6f | 61 64 69 6e 67 2c 20 61 |ystem lo|ading, a|
|00001710| 6e 64 20 6d 69 73 63 65 | 6c 6c 61 6e 65 6f 75 73 |nd misce|llaneous|
|00001720| 2e 20 54 68 65 73 65 20 | 63 61 6e 20 62 65 20 72 |. These |can be r|
|00001730| 6f 75 67 68 6c 79 20 64 | 69 76 69 64 65 64 0a 58 |oughly d|ivided.X|
|00001740| 69 6e 74 6f 20 74 68 65 | 20 6c 6f 77 2d 6c 65 76 |into the| low-lev|
|00001750| 65 6c 20 74 65 73 74 73 | 20 28 61 72 69 74 68 6d |el tests| (arithm|
|00001760| 65 74 69 63 2c 20 73 79 | 73 74 65 6d 20 63 61 6c |etic, sy|stem cal|
|00001770| 6c 73 2c 20 6d 65 6d 6f | 72 79 2c 20 64 69 73 6b |ls, memo|ry, disk|
|00001780| 2c 20 61 6e 64 0a 58 64 | 68 72 79 73 74 6f 6e 65 |, and.Xd|hrystone|
|00001790| 29 20 61 6e 64 20 68 69 | 67 68 2d 6c 65 76 65 6c |) and hi|gh-level|
|000017a0| 20 74 65 73 74 73 20 28 | 64 61 74 61 62 61 73 65 | tests (|database|
|000017b0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 2c 20 73 79 73 | operati|ons, sys|
|000017c0| 74 65 6d 20 6c 6f 61 64 | 69 6e 67 2c 20 61 6e 64 |tem load|ing, and|
|000017d0| 20 74 68 65 0a 58 43 2d | 63 6f 6d 70 69 6c 65 72 | the.XC-|compiler|
|000017e0| 20 74 65 73 74 20 74 68 | 61 74 20 69 73 20 70 61 | test th|at is pa|
|000017f0| 72 74 20 6f 66 20 74 68 | 65 20 6d 69 73 63 65 6c |rt of th|e miscel|
|00001800| 6c 61 6e 65 6f 75 73 20 | 73 65 74 29 2e 0a 58 20 |laneous |set)..X |
|00001810| 20 54 68 65 20 44 68 72 | 79 73 74 6f 6e 65 20 74 | The Dhr|ystone t|
|00001820| 65 73 74 20 69 73 20 6b | 6e 6f 77 6e 20 6d 6f 72 |est is k|nown mor|
|00001830| 65 20 66 6f 72 6d 61 6c | 6c 79 20 61 73 20 60 60 |e formal|ly as ``|
|00001840| 44 68 72 79 73 74 6f 6e | 65 20 32 27 27 2e 20 49 |Dhryston|e 2''. I|
|00001850| 74 20 70 65 72 66 6f 72 | 6d 73 0a 58 6e 6f 20 66 |t perfor|ms.Xno f|
|00001860| 6c 6f 61 74 69 6e 67 2d | 70 6f 69 6e 74 20 6f 70 |loating-|point op|
|00001870| 65 72 61 74 69 6f 6e 73 | 2c 20 62 75 74 20 69 74 |erations|, but it|
|00001880| 20 64 6f 65 73 20 69 6e | 76 6f 6c 76 65 20 61 72 | does in|volve ar|
|00001890| 72 61 79 73 2c 20 63 68 | 61 72 61 63 74 65 72 20 |rays, ch|aracter |
|000018a0| 73 74 72 69 6e 67 73 2c | 0a 58 69 6e 64 69 72 65 |strings,|.Xindire|
|000018b0| 63 74 20 61 64 64 72 65 | 73 73 69 6e 67 2c 20 61 |ct addre|ssing, a|
|000018c0| 6e 64 20 6d 6f 73 74 20 | 6f 66 20 74 68 65 20 6e |nd most |of the n|
|000018d0| 6f 6e 2d 66 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |on-float|ing poin|
|000018e0| 74 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 20 74 |t instru|ctions t|
|000018f0| 68 61 74 0a 58 6d 69 67 | 68 74 20 62 65 20 66 6f |hat.Xmig|ht be fo|
|00001900| 75 6e 64 20 69 6e 20 61 | 6e 20 61 70 70 6c 69 63 |und in a|n applic|
|00001910| 61 74 69 6f 6e 20 70 72 | 6f 67 72 61 6d 2e 20 49 |ation pr|ogram. I|
|00001920| 74 20 61 6c 73 6f 20 69 | 6e 63 6c 75 64 65 73 20 |t also i|ncludes |
|00001930| 63 6f 6e 64 69 74 69 6f | 6e 61 6c 0a 58 6f 70 65 |conditio|nal.Xope|
|00001940| 72 61 74 69 6f 6e 73 20 | 61 6e 64 20 6f 74 68 65 |rations |and othe|
|00001950| 72 20 63 6f 6d 6d 6f 6e | 20 70 72 6f 67 72 61 6d |r common| program|
|00001960| 20 66 6c 6f 77 20 63 6f | 6e 74 72 6f 6c 73 2e 20 | flow co|ntrols. |
|00001970| 54 68 65 20 6f 75 74 70 | 75 74 20 6f 66 20 74 68 |The outp|ut of th|
|00001980| 65 20 74 65 73 74 20 69 | 73 0a 58 74 68 65 20 6e |e test i|s.Xthe n|
|00001990| 75 6d 62 65 72 20 6f 66 | 20 64 68 72 79 73 74 6f |umber of| dhrysto|
|000019a0| 6e 65 20 6c 6f 6f 70 73 | 20 70 65 72 20 73 65 63 |ne loops| per sec|
|000019b0| 6f 6e 64 2e 20 49 74 20 | 69 73 20 75 73 65 64 20 |ond. It |is used |
|000019c0| 69 6e 20 74 68 65 20 42 | 59 54 45 20 62 65 6e 63 |in the B|YTE benc|
|000019d0| 68 6d 61 72 6b 73 0a 58 | 62 65 63 61 75 73 65 20 |hmarks.X|because |
|000019e0| 6f 66 20 69 74 73 20 77 | 69 64 65 20 73 65 6c 65 |of its w|ide sele|
|000019f0| 63 74 69 6f 6e 20 6f 66 | 20 6f 70 65 72 61 74 69 |ction of| operati|
|00001a00| 6f 6e 73 20 61 6e 64 20 | 62 65 63 61 75 73 65 20 |ons and |because |
|00001a10| 69 74 20 69 73 20 6f 6e | 65 20 6f 66 20 74 68 65 |it is on|e of the|
|00001a20| 20 6d 6f 73 74 0a 58 77 | 69 64 65 6c 79 20 72 75 | most.Xw|idely ru|
|00001a30| 6e 20 62 65 6e 63 68 6d | 61 72 6b 20 70 72 6f 67 |n benchm|ark prog|
|00001a40| 72 61 6d 73 2e 0a 58 20 | 20 41 20 66 75 74 75 72 |rams..X | A futur|
|00001a50| 65 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 65 |e versio|n of the|
|00001a60| 20 42 59 54 45 20 55 4e | 49 58 20 62 65 6e 63 68 | BYTE UN|IX bench|
|00001a70| 6d 61 72 6b 73 20 77 69 | 6c 6c 20 69 6e 63 6c 75 |marks wi|ll inclu|
|00001a80| 64 65 20 74 68 65 20 57 | 68 65 74 73 74 6f 6e 65 |de the W|hetstone|
|00001a90| 0a 58 62 65 6e 63 68 6d | 61 72 6b 20 74 65 73 74 |.Xbenchm|ark test|
|00001aa0| 20 70 72 6f 67 72 61 6d | 2c 20 61 73 20 77 65 6c | program|, as wel|
|00001ab0| 6c 2e 20 54 68 65 20 57 | 68 65 74 73 74 6f 6e 65 |l. The W|hetstone|
|00001ac0| 20 62 65 6e 63 68 6d 61 | 72 6b 20 69 73 20 63 6f | benchma|rk is co|
|00001ad0| 6e 63 65 70 74 75 61 6c | 6c 79 0a 58 73 69 6d 69 |nceptual|ly.Xsimi|
|00001ae0| 6c 61 72 20 74 6f 20 74 | 68 65 20 44 68 72 79 73 |lar to t|he Dhrys|
|00001af0| 74 6f 6e 65 2c 20 62 75 | 74 20 77 69 74 68 20 61 |tone, bu|t with a|
|00001b00| 6e 20 65 6d 70 68 61 73 | 69 73 20 6f 6e 20 6d 61 |n emphas|is on ma|
|00001b10| 74 68 3b 20 69 74 20 69 | 73 20 61 20 6d 69 78 20 |th; it i|s a mix |
|00001b20| 6f 66 0a 58 66 6c 6f 61 | 74 69 6e 67 20 70 6f 69 |of.Xfloa|ting poi|
|00001b30| 6e 74 20 61 6e 64 20 69 | 6e 74 65 67 65 72 20 61 |nt and i|nteger a|
|00001b40| 72 69 74 68 6d 65 74 69 | 63 2c 20 66 75 6e 63 74 |rithmeti|c, funct|
|00001b50| 69 6f 6e 20 63 61 6c 6c | 73 2c 20 61 72 72 61 79 |ion call|s, array|
|00001b60| 20 6f 70 65 72 61 74 69 | 6f 6e 73 2c 0a 58 63 6f | operati|ons,.Xco|
|00001b70| 6e 64 69 74 69 6f 6e 61 | 6c 73 2c 20 61 6e 64 20 |nditiona|ls, and |
|00001b80| 74 72 61 6e 73 63 65 6e | 64 65 6e 74 61 6c 20 66 |transcen|dental f|
|00001b90| 75 6e 63 74 69 6f 6e 20 | 63 61 6c 6c 73 2e 0a 58 |unction |calls..X|
|00001ba0| 20 20 41 6c 6c 20 74 68 | 65 20 61 72 69 74 68 6d | All th|e arithm|
|00001bb0| 65 74 69 63 20 74 65 73 | 74 73 20 68 61 76 65 20 |etic tes|ts have |
|00001bc0| 74 68 65 20 73 61 6d 65 | 20 73 6f 75 72 63 65 20 |the same| source |
|00001bd0| 63 6f 64 65 20 77 69 74 | 68 20 64 69 66 66 65 72 |code wit|h differ|
|00001be0| 65 6e 74 20 64 61 74 61 | 0a 58 74 79 70 65 73 20 |ent data|.Xtypes |
|00001bf0| 73 75 62 73 74 69 74 75 | 74 65 64 20 66 6f 72 20 |substitu|ted for |
|00001c00| 74 68 65 20 6f 70 65 72 | 61 74 69 6f 6e 73 3a 20 |the oper|ations: |
|00001c10| 72 65 67 69 73 74 65 72 | 2c 20 73 68 6f 72 74 2c |register|, short,|
|00001c20| 20 69 6e 74 2c 20 6c 6f | 6e 67 2c 20 66 6c 6f 61 | int, lo|ng, floa|
|00001c30| 74 2c 0a 58 64 6f 75 62 | 6c 65 2c 20 61 6e 64 20 |t,.Xdoub|le, and |
|00001c40| 61 6e 20 65 6d 70 74 79 | 20 6c 6f 6f 70 20 66 6f |an empty| loop fo|
|00001c50| 72 20 63 61 6c 63 75 6c | 61 74 69 6e 67 20 74 68 |r calcul|ating th|
|00001c60| 65 20 6f 76 65 72 68 65 | 61 64 20 72 65 71 75 69 |e overhe|ad requi|
|00001c70| 72 65 64 20 62 79 20 74 | 68 65 0a 58 70 72 6f 67 |red by t|he.Xprog|
|00001c80| 72 61 6d 2e 20 54 68 65 | 20 61 63 74 75 61 6c 20 |ram. The| actual |
|00001c90| 74 65 73 74 20 69 6e 76 | 6f 6c 76 65 73 20 61 73 |test inv|olves as|
|00001ca0| 73 69 67 6e 6d 65 6e 74 | 2c 20 61 64 64 69 74 69 |signment|, additi|
|00001cb0| 6f 6e 2c 20 73 75 62 74 | 72 61 63 74 69 6f 6e 2c |on, subt|raction,|
|00001cc0| 0a 58 6d 75 6c 74 69 70 | 6c 69 63 61 74 69 6f 6e |.Xmultip|lication|
|00001cd0| 2c 20 61 6e 64 20 64 69 | 76 69 73 69 6f 6e 2e 20 |, and di|vision. |
|00001ce0| 56 65 72 79 20 73 69 6d | 70 6c 65 2e 20 42 75 74 |Very sim|ple. But|
|00001cf0| 20 64 6f 6e 27 74 20 62 | 6f 74 68 65 72 20 72 75 | don't b|other ru|
|00001d00| 6e 6e 69 6e 67 20 74 68 | 65 20 66 6c 6f 61 74 0a |nning th|e float.|
|00001d10| 58 61 6e 64 20 64 6f 75 | 62 6c 65 20 70 72 65 63 |Xand dou|ble prec|
|00001d20| 69 73 69 6f 6e 20 74 65 | 73 74 20 75 6e 6c 65 73 |ision te|st unles|
|00001d30| 73 20 79 6f 75 20 68 61 | 76 65 20 61 20 6d 61 74 |s you ha|ve a mat|
|00001d40| 68 20 63 6f 2d 70 72 6f | 63 65 73 73 6f 72 3b 20 |h co-pro|cessor; |
|00001d50| 77 68 61 74 20 74 61 6b | 65 73 20 61 0a 58 6d 61 |what tak|es a.Xma|
|00001d60| 74 68 20 63 6f 2d 70 72 | 6f 63 65 73 73 6f 72 20 |th co-pr|ocessor |
|00001d70| 73 79 73 74 65 6d 20 31 | 35 20 73 65 63 6f 6e 64 |system 1|5 second|
|00001d80| 73 2c 20 6d 61 79 20 74 | 61 6b 65 20 61 6e 20 75 |s, may t|ake an u|
|00001d90| 6e 61 69 64 65 64 20 70 | 72 6f 63 65 73 73 6f 72 |naided p|rocessor|
|00001da0| 20 33 30 20 6d 69 6e 75 | 74 65 73 0a 58 6f 72 20 | 30 minu|tes.Xor |
|00001db0| 6d 6f 72 65 21 0a 58 20 | 20 54 68 65 20 73 79 73 |more!.X | The sys|
|00001dc0| 74 65 6d 20 63 61 6c 6c | 20 74 65 73 74 73 20 61 |tem call| tests a|
|00001dd0| 72 65 3a 20 73 79 73 74 | 65 6d 20 63 61 6c 6c 20 |re: syst|em call |
|00001de0| 6f 76 65 72 68 65 61 64 | 2c 20 70 69 70 65 20 74 |overhead|, pipe t|
|00001df0| 68 72 6f 75 67 68 70 75 | 74 2c 20 70 69 70 65 0a |hroughpu|t, pipe.|
|00001e00| 58 63 6f 6e 74 65 78 74 | 20 73 77 69 74 63 68 69 |Xcontext| switchi|
|00001e10| 6e 67 2c 20 73 70 61 77 | 6e 69 6e 67 20 6f 66 20 |ng, spaw|ning of |
|00001e20| 63 68 69 6c 64 20 70 72 | 6f 63 65 73 73 65 73 2c |child pr|ocesses,|
|00001e30| 20 65 78 65 63 6c 20 28 | 72 65 70 6c 61 63 65 6d | execl (|replacem|
|00001e40| 65 6e 74 20 6f 66 20 74 | 68 65 0a 58 63 75 72 72 |ent of t|he.Xcurr|
|00001e50| 65 6e 74 20 70 72 6f 63 | 65 73 73 20 62 79 20 61 |ent proc|ess by a|
|00001e60| 20 6e 65 77 20 70 72 6f | 63 65 73 73 29 2c 20 61 | new pro|cess), a|
|00001e70| 6e 64 20 66 69 6c 65 20 | 72 65 61 64 2c 20 77 72 |nd file |read, wr|
|00001e80| 69 74 65 2c 20 61 6e 64 | 20 63 6f 70 79 2e 20 54 |ite, and| copy. T|
|00001e90| 68 65 20 73 79 73 74 65 | 6d 0a 58 63 61 6c 6c 20 |he syste|m.Xcall |
|00001ea0| 6f 76 65 72 68 65 61 64 | 20 74 65 73 74 20 65 76 |overhead| test ev|
|00001eb0| 61 6c 75 61 74 65 73 20 | 74 68 65 20 74 69 6d 65 |aluates |the time|
|00001ec0| 20 72 65 71 75 69 72 65 | 64 20 74 6f 20 64 6f 20 | require|d to do |
|00001ed0| 69 74 65 72 61 74 69 6f | 6e 73 20 6f 66 0a 58 21 |iteratio|ns of.X!|
|00001ee0| 4d 4f 4e 4f 21 64 75 70 | 28 29 21 45 4e 44 4d 4f |MONO!dup|()!ENDMO|
|00001ef0| 4e 4f 21 2c 20 21 4d 4f | 4e 4f 21 63 6c 6f 73 65 |NO!, !MO|NO!close|
|00001f00| 28 29 21 45 4e 44 4d 4f | 4e 4f 21 2c 20 21 4d 4f |()!ENDMO|NO!, !MO|
|00001f10| 4e 4f 21 67 65 74 70 69 | 64 28 29 21 45 4e 44 4d |NO!getpi|d()!ENDM|
|00001f20| 4f 4e 4f 21 2c 0a 58 21 | 4d 4f 4e 4f 21 67 65 74 |ONO!,.X!|MONO!get|
|00001f30| 75 69 64 28 29 21 45 4e | 44 4d 4f 4e 4f 21 2c 20 |uid()!EN|DMONO!, |
|00001f40| 61 6e 64 20 21 4d 4f 4e | 4f 21 75 6d 61 73 6b 28 |and !MON|O!umask(|
|00001f50| 29 21 45 4e 44 4d 4f 4e | 4f 21 20 63 61 6c 6c 73 |)!ENDMON|O! calls|
|00001f60| 2e 0a 58 20 20 54 68 65 | 20 70 69 70 65 20 74 68 |..X The| pipe th|
|00001f70| 72 6f 75 67 68 70 75 74 | 20 74 65 73 74 20 68 61 |roughput| test ha|
|00001f80| 73 20 6e 6f 20 72 65 61 | 6c 20 63 6f 75 6e 74 65 |s no rea|l counte|
|00001f90| 72 70 61 72 74 20 69 6e | 20 72 65 61 6c 2d 77 6f |rpart in| real-wo|
|00001fa0| 72 6c 64 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 3b |rld prog|ramming;|
|00001fb0| 0a 58 69 6e 20 69 74 2c | 20 61 20 73 69 6e 67 6c |.Xin it,| a singl|
|00001fc0| 65 20 70 72 6f 63 65 73 | 73 20 6f 70 65 6e 73 20 |e proces|s opens |
|00001fd0| 61 20 70 69 70 65 20 28 | 61 6e 20 69 6e 74 65 72 |a pipe (|an inter|
|00001fe0| 2d 70 72 6f 63 65 73 73 | 20 63 6f 6d 6d 75 6e 69 |-process| communi|
|00001ff0| 63 61 74 69 6f 6e 73 20 | 63 68 61 6e 6e 65 6c 0a |cations |channel.|
|00002000| 58 74 68 61 74 20 77 6f | 72 6b 73 20 72 61 74 68 |Xthat wo|rks rath|
|00002010| 65 72 20 6c 69 6b 65 20 | 69 74 73 20 70 6c 75 6d |er like |its plum|
|00002020| 62 69 6e 67 20 6e 61 6d | 65 73 61 6b 65 29 20 74 |bing nam|esake) t|
|00002030| 6f 20 69 74 73 65 6c 66 | 20 61 6e 64 20 73 70 69 |o itself| and spi|
|00002040| 6e 73 20 61 20 6d 65 67 | 61 62 79 74 65 0a 58 61 |ns a meg|abyte.Xa|
|00002050| 72 6f 75 6e 64 20 74 68 | 69 73 20 73 68 6f 72 74 |round th|is short|
|00002060| 20 6c 6f 6f 70 2e 20 59 | 6f 75 20 6d 69 67 68 74 | loop. Y|ou might|
|00002070| 20 63 61 6c 6c 20 74 68 | 69 73 20 74 68 65 20 70 | call th|is the p|
|00002080| 69 70 65 20 6f 76 65 72 | 68 65 61 64 20 74 65 73 |ipe over|head tes|
|00002090| 74 2e 20 54 68 65 0a 58 | 63 6f 6e 74 65 78 74 20 |t. The.X|context |
|000020a0| 73 77 69 74 63 68 69 6e | 67 20 70 69 70 65 20 74 |switchin|g pipe t|
|000020b0| 65 73 74 20 69 73 20 6d | 6f 72 65 20 6c 69 6b 65 |est is m|ore like|
|000020c0| 20 61 20 72 65 61 6c 2d | 77 6f 72 6c 64 20 61 70 | a real-|world ap|
|000020d0| 70 6c 69 63 61 74 69 6f | 6e 3b 20 74 68 65 20 74 |plicatio|n; the t|
|000020e0| 65 73 74 0a 58 70 72 6f | 67 72 61 6d 20 73 70 61 |est.Xpro|gram spa|
|000020f0| 77 6e 73 20 61 20 63 68 | 69 6c 64 20 70 72 6f 63 |wns a ch|ild proc|
|00002100| 65 73 73 20 77 69 74 68 | 20 77 68 69 63 68 20 69 |ess with| which i|
|00002110| 74 20 63 61 72 72 69 65 | 73 20 6f 6e 20 61 20 62 |t carrie|s on a b|
|00002120| 69 2d 64 69 72 65 63 74 | 69 6f 6e 61 6c 20 70 69 |i-direct|ional pi|
|00002130| 70 65 0a 58 63 6f 6e 76 | 65 72 73 61 74 69 6f 6e |pe.Xconv|ersation|
|00002140| 2e 0a 58 20 20 54 68 65 | 20 73 70 61 77 6e 20 74 |..X The| spawn t|
|00002150| 65 73 74 20 63 72 65 61 | 74 65 73 20 61 20 63 68 |est crea|tes a ch|
|00002160| 69 6c 64 20 70 72 6f 63 | 65 73 73 20 77 68 69 63 |ild proc|ess whic|
|00002170| 68 20 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 64 69 |h immedi|ately di|
|00002180| 65 73 20 61 66 74 65 72 | 20 69 74 73 20 6f 77 6e |es after| its own|
|00002190| 0a 58 21 4d 4f 4e 4f 21 | 66 6f 72 6b 28 29 21 45 |.X!MONO!|fork()!E|
|000021a0| 4e 44 4d 4f 4e 4f 21 2e | 20 54 68 65 20 70 72 6f |NDMONO!.| The pro|
|000021b0| 63 65 73 73 20 69 73 20 | 72 65 70 65 61 74 65 64 |cess is |repeated|
|000021c0| 20 6f 76 65 72 20 61 6e | 64 20 6f 76 65 72 2e 20 | over an|d over. |
|000021d0| 53 69 6d 69 6c 61 72 6c | 79 2c 20 74 68 65 0a 58 |Similarl|y, the.X|
|000021e0| 65 78 65 63 20 74 65 73 | 74 20 69 73 20 61 20 70 |exec tes|t is a p|
|000021f0| 72 6f 63 65 73 73 20 74 | 68 61 74 20 72 65 70 65 |rocess t|hat repe|
|00002200| 61 74 65 64 6c 79 20 63 | 68 61 6e 67 65 73 20 74 |atedly c|hanges t|
|00002210| 6f 20 61 20 6e 65 77 20 | 69 6e 63 61 72 6e 61 74 |o a new |incarnat|
|00002220| 69 6f 6e 2e 20 4f 6e 65 | 20 6f 66 0a 58 74 68 65 |ion. One| of.Xthe|
|00002230| 20 61 72 67 75 6d 65 6e | 74 73 20 70 61 73 73 65 | argumen|ts passe|
|00002240| 64 20 74 6f 20 74 68 65 | 20 6e 65 77 20 69 6e 63 |d to the| new inc|
|00002250| 61 72 6e 61 74 69 6f 6e | 20 69 73 20 74 68 65 20 |arnation| is the |
|00002260| 6e 75 6d 62 65 72 20 6f | 66 20 72 65 6d 61 69 6e |number o|f remain|
|00002270| 69 6e 67 0a 58 69 74 65 | 72 61 74 69 6f 6e 73 20 |ing.Xite|rations |
|00002280| 28 74 68 65 72 65 20 68 | 61 73 20 74 6f 20 62 65 |(there h|as to be|
|00002290| 20 73 6f 6d 65 20 63 6f | 6e 74 72 6f 6c 2c 20 61 | some co|ntrol, a|
|000022a0| 66 74 65 72 20 61 6c 6c | 29 2e 0a 58 20 54 68 65 |fter all|)..X The|
|000022b0| 20 66 69 6c 65 20 72 65 | 61 64 2c 20 77 72 69 74 | file re|ad, writ|
|000022c0| 65 2c 20 61 6e 64 20 63 | 6f 70 79 20 74 65 73 74 |e, and c|opy test|
|000022d0| 73 20 63 61 70 74 75 72 | 65 20 74 68 65 20 6e 75 |s captur|e the nu|
|000022e0| 6d 62 65 72 20 6f 66 20 | 63 68 61 72 61 63 74 65 |mber of |characte|
|000022f0| 72 73 20 74 68 61 74 0a | 58 63 61 6e 20 62 65 20 |rs that.|Xcan be |
|00002300| 77 72 69 74 74 65 6e 2c | 20 72 65 61 64 2c 20 61 |written,| read, a|
|00002310| 6e 64 20 63 6f 70 69 65 | 64 20 69 6e 20 61 20 73 |nd copie|d in a s|
|00002320| 70 65 63 69 66 69 65 64 | 20 74 69 6d 65 20 28 64 |pecified| time (d|
|00002330| 65 66 61 75 6c 74 20 69 | 73 20 31 30 20 73 65 63 |efault i|s 10 sec|
|00002340| 6f 6e 64 73 29 2e 0a 58 | 49 66 20 79 6f 75 20 72 |onds)..X|If you r|
|00002350| 75 6e 20 74 68 69 73 20 | 74 65 73 74 20 77 69 74 |un this |test wit|
|00002360| 68 20 74 68 65 20 6d 69 | 6e 69 6d 75 6d 20 65 6c |h the mi|nimum el|
|00002370| 65 6d 65 6e 74 20 28 31 | 20 73 65 63 6f 6e 64 29 |ement (1| second)|
|00002380| 2c 20 79 6f 75 20 73 68 | 6f 75 6c 64 20 73 65 65 |, you sh|ould see|
|00002390| 20 61 0a 58 73 69 67 6e | 69 66 69 63 61 6e 74 6c | a.Xsign|ificantl|
|000023a0| 79 20 68 69 67 68 65 72 | 20 76 61 6c 75 65 20 66 |y higher| value f|
|000023b0| 6f 72 20 61 6c 6c 20 6f | 70 65 72 61 74 69 6f 6e |or all o|peration|
|000023c0| 73 20 69 66 20 79 6f 75 | 72 20 73 79 73 74 65 6d |s if you|r system|
|000023d0| 20 69 6d 70 6c 65 6d 65 | 6e 74 73 20 64 69 73 6b | impleme|nts disk|
|000023e0| 0a 58 63 61 63 68 65 69 | 6e 67 2e 20 42 65 20 73 |.Xcachei|ng. Be s|
|000023f0| 75 72 65 20 79 6f 75 20 | 68 61 76 65 20 70 6c 65 |ure you |have ple|
|00002400| 6e 74 79 20 6f 66 20 64 | 69 73 6b 20 73 70 61 63 |nty of d|isk spac|
|00002410| 65 20 62 65 66 6f 72 65 | 20 79 6f 75 20 72 75 6e |e before| you run|
|00002420| 20 74 68 69 73 20 74 65 | 73 74 2e 0a 58 0a 58 21 | this te|st..X.X!|
|00002430| 53 55 42 48 45 44 21 54 | 68 65 20 48 69 67 68 2d |SUBHED!T|he High-|
|00002440| 4c 65 76 65 6c 20 42 65 | 6e 63 68 20 50 72 6f 67 |Level Be|nch Prog|
|00002450| 72 61 6d 73 21 45 4e 44 | 53 55 42 48 45 44 21 0a |rams!END|SUBHED!.|
|00002460| 58 54 6f 20 71 75 61 6c | 69 66 79 20 61 73 20 61 |XTo qual|ify as a|
|00002470| 20 68 69 67 68 2d 6c 65 | 76 65 6c 20 74 65 73 74 | high-le|vel test|
|00002480| 2c 20 74 68 65 20 74 65 | 73 74 20 6d 75 73 74 20 |, the te|st must |
|00002490| 69 6e 76 6f 6c 76 65 20 | 6f 70 65 72 61 74 69 6f |involve |operatio|
|000024a0| 6e 73 20 74 68 61 74 20 | 61 0a 58 72 65 61 6c 2d |ns that |a.Xreal-|
|000024b0| 77 6f 72 6c 64 20 61 70 | 70 6c 69 63 61 74 69 6f |world ap|plicatio|
|000024c0| 6e 20 70 72 6f 67 72 61 | 6d 20 6d 69 67 68 74 20 |n progra|m might |
|000024d0| 65 6d 70 6c 6f 79 2c 20 | 69 6e 63 6c 75 64 69 6e |employ, |includin|
|000024e0| 67 20 68 65 61 76 79 20 | 75 73 65 20 6f 66 20 74 |g heavy |use of t|
|000024f0| 68 65 20 43 50 55 0a 58 | 61 6e 64 20 64 69 73 6b |he CPU.X|and disk|
|00002500| 2e 20 41 74 20 74 68 65 | 20 74 69 6d 65 20 6f 66 |. At the| time of|
|00002510| 20 77 72 69 74 69 6e 67 | 20 74 68 69 73 20 61 72 | writing| this ar|
|00002520| 74 69 63 6c 65 2c 20 77 | 65 20 68 61 76 65 20 63 |ticle, w|e have c|
|00002530| 75 72 72 65 6e 74 6c 79 | 20 69 6d 70 6c 65 6d 65 |urrently| impleme|
|00002540| 6e 74 65 64 0a 58 6f 6e | 6c 79 20 74 68 65 20 73 |nted.Xon|ly the s|
|00002550| 79 73 74 65 6d 20 6c 6f | 61 64 69 6e 67 20 61 6e |ystem lo|ading an|
|00002560| 64 20 64 61 74 61 62 61 | 73 65 20 74 65 73 74 73 |d databa|se tests|
|00002570| 2c 20 62 75 74 20 77 65 | 20 77 69 6c 6c 20 62 65 |, but we| will be|
|00002580| 20 61 64 64 69 6e 67 20 | 73 65 76 65 72 61 6c 20 | adding |several |
|00002590| 6e 65 77 0a 58 74 65 73 | 74 73 20 69 6e 20 74 68 |new.Xtes|ts in th|
|000025a0| 65 20 6d 6f 6e 74 68 73 | 20 61 68 65 61 64 2e 0a |e months| ahead..|
|000025b0| 58 20 20 54 68 65 20 73 | 79 73 74 65 6d 20 6c 6f |X The s|ystem lo|
|000025c0| 61 64 69 6e 67 20 74 65 | 73 74 20 69 73 20 61 20 |ading te|st is a |
|000025d0| 73 68 65 6c 6c 20 73 63 | 72 69 70 74 20 74 68 61 |shell sc|ript tha|
|000025e0| 74 20 69 73 20 72 75 6e | 20 62 79 20 31 2c 20 32 |t is run| by 1, 2|
|000025f0| 2c 20 34 2c 20 61 6e 64 | 20 38 0a 58 63 6f 6e 63 |, 4, and| 8.Xconc|
|00002600| 75 72 72 65 6e 74 20 70 | 72 6f 63 65 73 73 65 73 |urrent p|rocesses|
|00002610| 2e 20 54 68 65 20 73 63 | 72 69 70 74 20 63 6f 6e |. The sc|ript con|
|00002620| 73 69 73 74 73 20 6f 66 | 20 61 6e 20 61 6c 70 68 |sists of| an alph|
|00002630| 61 62 65 74 69 63 20 73 | 6f 72 74 20 6f 6e 65 20 |abetic s|ort one |
|00002640| 66 69 6c 65 20 74 6f 0a | 58 61 6e 6f 74 68 65 72 |file to.|Xanother|
|00002650| 3b 20 74 61 6b 69 6e 67 | 20 74 68 65 20 6f 63 74 |; taking| the oct|
|00002660| 61 6c 20 64 75 6d 70 20 | 6f 66 20 74 68 65 20 72 |al dump |of the r|
|00002670| 65 73 75 6c 74 20 61 6e | 64 20 64 6f 69 6e 67 20 |esult an|d doing |
|00002680| 61 20 6e 75 6d 65 72 69 | 63 20 73 6f 72 74 20 74 |a numeri|c sort t|
|00002690| 6f 20 61 0a 58 74 68 69 | 72 64 20 66 69 6c 65 3b |o a.Xthi|rd file;|
|000026a0| 20 72 75 6e 6e 69 6e 67 | 20 67 72 65 70 20 6f 6e | running| grep on|
|000026b0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 74 | the res|ult of t|
|000026c0| 68 65 20 61 6c 70 68 61 | 62 65 74 69 63 20 73 6f |he alpha|betic so|
|000026d0| 72 74 20 66 69 6c 65 3b | 0a 58 21 4d 4f 4e 4f 21 |rt file;|.X!MONO!|
|000026e0| 74 65 65 21 45 4e 44 4d | 4f 4e 4f 21 69 6e 67 20 |tee!ENDM|ONO!ing |
|000026f0| 74 68 65 20 72 65 73 75 | 6c 74 20 74 6f 20 61 20 |the resu|lt to a |
|00002700| 66 69 6c 65 20 61 6e 64 | 20 74 6f 20 21 4d 4f 4e |file and| to !MON|
|00002710| 4f 21 77 63 21 45 4e 44 | 4d 4f 4e 4f 21 20 28 77 |O!wc!END|MONO! (w|
|00002720| 6f 72 64 0a 58 63 6f 75 | 6e 74 29 3b 20 77 72 69 |ord.Xcou|nt); wri|
|00002730| 74 69 6e 67 20 74 68 65 | 20 66 69 6e 61 6c 20 72 |ting the| final r|
|00002740| 65 73 75 6c 74 20 74 6f | 20 61 20 66 69 6c 65 3b |esult to| a file;|
|00002750| 20 61 6e 64 20 72 65 6d | 6f 76 69 6e 67 20 61 6c | and rem|oving al|
|00002760| 6c 20 6f 66 20 74 68 65 | 20 72 65 73 75 6c 74 69 |l of the| resulti|
|00002770| 6e 67 0a 58 66 69 6c 65 | 73 2e 20 54 68 69 73 20 |ng.Xfile|s. This |
|00002780| 73 63 72 69 70 74 20 77 | 61 73 20 75 73 65 64 20 |script w|as used |
|00002790| 69 6e 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |in the o|riginal |
|000027a0| 42 59 54 45 20 55 4e 49 | 58 20 62 65 6e 63 68 6d |BYTE UNI|X benchm|
|000027b0| 61 72 6b 73 20 28 31 39 | 38 33 29 2c 20 62 75 74 |arks (19|83), but|
|000027c0| 0a 58 74 68 65 20 73 6f | 75 72 63 65 20 66 69 6c |.Xthe so|urce fil|
|000027d0| 65 20 69 73 20 73 65 76 | 65 72 61 6c 20 6d 61 67 |e is sev|eral mag|
|000027e0| 6e 69 74 75 64 65 73 20 | 6c 61 72 67 65 72 20 74 |nitudes |larger t|
|000027f0| 68 61 6e 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |han the |original|
|00002800| 2e 0a 58 20 20 54 68 65 | 20 43 20 63 6f 6d 70 69 |..X The| C compi|
|00002810| 6c 65 20 61 6e 64 20 6c | 69 6e 6b 20 69 73 20 6e |le and l|ink is n|
|00002820| 6f 74 68 69 6e 67 20 6d | 6f 72 65 20 74 68 61 6e |othing m|ore than|
|00002830| 20 74 68 61 74 2e 0a 58 | 20 20 54 68 65 20 64 61 | that..X| The da|
|00002840| 74 61 62 61 73 65 20 6f | 70 65 72 61 74 69 6f 6e |tabase o|peration|
|00002850| 73 20 63 6f 6e 73 69 73 | 74 20 6f 66 20 72 61 6e |s consis|t of ran|
|00002860| 64 6f 6d 20 72 65 61 64 | 2c 20 77 72 69 74 65 2c |dom read|, write,|
|00002870| 20 61 6e 64 20 61 64 64 | 20 6f 70 65 72 61 74 69 | and add| operati|
|00002880| 6f 6e 73 0a 58 6f 6e 20 | 61 20 64 61 74 61 62 61 |ons.Xon |a databa|
|00002890| 73 65 20 66 69 6c 65 2e | 20 54 68 65 20 6f 70 65 |se file.| The ope|
|000028a0| 72 61 74 69 6f 6e 73 20 | 61 72 65 20 68 61 6e 64 |rations |are hand|
|000028b0| 6c 65 64 20 62 79 20 61 | 20 73 65 72 76 65 72 20 |led by a| server |
|000028c0| 70 72 6f 63 65 73 73 3b | 20 74 68 65 0a 58 72 65 |process;| the.Xre|
|000028d0| 71 75 65 73 74 73 20 63 | 6f 6d 65 20 66 72 6f 6d |quests c|ome from|
|000028e0| 20 63 6c 69 65 6e 74 20 | 70 72 6f 63 65 73 73 65 | client |processe|
|000028f0| 73 2e 20 54 68 65 20 74 | 65 73 74 20 69 73 20 72 |s. The t|est is r|
|00002900| 75 6e 20 77 69 74 68 20 | 31 2c 20 32 2c 20 34 2c |un with |1, 2, 4,|
|00002910| 20 61 6e 64 20 38 0a 58 | 63 6c 69 65 6e 74 20 70 | and 8.X|client p|
|00002920| 72 6f 63 65 73 73 65 73 | 2e 20 54 68 65 20 74 65 |rocesses|. The te|
|00002930| 73 74 20 65 6d 70 6c 6f | 79 73 20 73 65 6d 61 70 |st emplo|ys semap|
|00002940| 68 6f 72 65 73 20 61 6e | 64 20 6d 65 73 73 61 67 |hores an|d messag|
|00002950| 65 20 71 75 65 75 65 73 | 2e 20 53 65 6d 61 70 68 |e queues|. Semaph|
|00002960| 6f 72 65 73 0a 58 61 72 | 65 20 62 65 69 6e 67 20 |ores.Xar|e being |
|00002970| 75 73 65 64 20 6c 65 73 | 73 20 61 6e 64 20 6c 65 |used les|s and le|
|00002980| 73 73 20 74 68 65 73 65 | 20 64 61 79 73 2e 20 42 |ss these| days. B|
|00002990| 53 44 20 73 79 73 74 65 | 6d 73 20 75 73 65 20 73 |SD syste|ms use s|
|000029a0| 6f 63 6b 65 74 73 20 69 | 6e 73 74 65 61 64 20 69 |ockets i|nstead i|
|000029b0| 6e 0a 58 70 6c 61 63 65 | 20 6f 66 20 62 6f 74 68 |n.Xplace| of both|
|000029c0| 20 6f 66 20 74 68 65 73 | 65 20 53 79 73 74 65 6d | of thes|e System|
|000029d0| 20 56 2e 33 20 49 50 43 | 20 75 74 69 6c 69 74 69 | V.3 IPC| utiliti|
|000029e0| 65 73 2e 20 53 79 73 74 | 65 6d 20 56 2e 34 20 6f |es. Syst|em V.4 o|
|000029f0| 66 66 65 72 73 20 62 6f | 74 68 2e 20 54 68 69 73 |ffers bo|th. This|
|00002a00| 0a 58 74 65 73 74 20 69 | 73 20 62 65 69 6e 67 20 |.Xtest i|s being |
|00002a10| 72 65 77 72 69 74 74 65 | 6e 20 75 73 69 6e 67 20 |rewritte|n using |
|00002a20| 73 6f 63 6b 65 74 73 2c | 20 62 75 74 20 73 69 6e |sockets,| but sin|
|00002a30| 63 65 20 58 65 6e 69 78 | 20 64 6f 65 73 6e 27 74 |ce Xenix| doesn't|
|00002a40| 20 69 6d 70 6c 65 6d 65 | 6e 74 0a 58 73 6f 63 6b | impleme|nt.Xsock|
|00002a50| 65 74 73 2c 20 6f 75 72 | 20 62 61 73 65 6c 69 6e |ets, our| baselin|
|00002a60| 65 20 63 6f 6e 66 69 67 | 75 72 61 74 69 6f 6e 20 |e config|uration |
|00002a70| 62 65 63 6f 6d 65 73 20 | 69 6e 73 74 61 6e 74 6c |becomes |instantl|
|00002a80| 79 20 6f 62 73 6f 6c 65 | 74 65 20 77 68 65 6e 20 |y obsole|te when |
|00002a90| 77 65 0a 58 72 65 70 6c | 61 63 65 20 74 68 65 20 |we.Xrepl|ace the |
|00002aa0| 64 61 74 61 62 61 73 65 | 20 74 65 73 74 2e 20 4a |database| test. J|
|00002ab0| 75 73 74 20 61 6e 6f 74 | 68 65 72 20 6f 6e 65 20 |ust anot|her one |
|00002ac0| 6f 66 20 74 68 6f 73 65 | 20 6c 69 74 74 6c 65 20 |of those| little |
|00002ad0| 70 72 6f 62 6c 65 6d 73 | 20 69 6e 0a 58 74 72 79 |problems| in.Xtry|
|00002ae0| 69 6e 67 20 74 6f 20 63 | 72 65 61 74 65 20 6a 6f |ing to c|reate jo|
|00002af0| 75 72 6e 61 6c 69 73 74 | 69 63 20 63 6f 6d 70 75 |urnalist|ic compu|
|00002b00| 74 65 72 20 62 65 6e 63 | 68 6d 61 72 6b 73 3a 20 |ter benc|hmarks: |
|00002b10| 61 6e 79 20 70 72 6f 67 | 72 61 6d 20 74 68 61 74 |any prog|ram that|
|00002b20| 20 68 61 73 20 62 65 65 | 6e 0a 58 66 75 6c 6c 79 | has bee|n.Xfully|
|00002b30| 20 64 65 62 75 67 67 65 | 64 20 69 73 20 70 72 6f | debugge|d is pro|
|00002b40| 62 61 62 6c 79 20 6f 62 | 73 6f 6c 65 74 65 20 5b |bably ob|solete [|
|00002b50| 20 4d 75 72 70 68 79 2c | 20 65 74 20 61 6c 20 5d | Murphy,| et al ]|
|00002b60| 2e 0a 58 0a 58 21 53 55 | 42 48 45 44 21 4d 69 73 |..X.X!SU|BHED!Mis|
|00002b70| 63 65 6c 6c 61 6e 79 21 | 45 4e 44 53 55 42 48 45 |cellany!|ENDSUBHE|
|00002b80| 44 21 0a 58 54 68 65 20 | 72 65 6d 61 69 6e 69 6e |D!.XThe |remainin|
|00002b90| 67 20 74 65 73 74 73 20 | 61 72 65 20 69 6e 20 74 |g tests |are in t|
|00002ba0| 68 65 20 6d 69 73 63 65 | 6c 6c 61 6e 65 6f 75 73 |he misce|llaneous|
|00002bb0| 20 67 72 6f 75 70 3a 20 | 54 6f 77 65 72 20 6f 66 | group: |Tower of|
|00002bc0| 20 48 61 6e 6f 69 20 28 | 61 20 74 65 73 74 20 6f | Hanoi (|a test o|
|00002bd0| 66 0a 58 72 65 63 75 72 | 73 69 76 65 20 6f 70 65 |f.Xrecur|sive ope|
|00002be0| 72 61 74 69 6f 6e 73 29 | 20 61 6e 64 20 61 20 74 |rations)| and a t|
|00002bf0| 65 73 74 20 6f 66 20 74 | 68 65 20 55 4e 49 58 20 |est of t|he UNIX |
|00002c00| 61 72 62 69 74 72 61 72 | 79 20 70 72 65 63 69 73 |arbitrar|y precis|
|00002c10| 69 6f 6e 20 63 61 6c 63 | 75 6c 61 74 6f 72 0a 58 |ion calc|ulator.X|
|00002c20| 63 61 6c 63 75 6c 61 74 | 69 6e 67 20 74 68 65 20 |calculat|ing the |
|00002c30| 73 71 75 61 72 65 20 72 | 6f 6f 74 20 6f 66 20 74 |square r|oot of t|
|00002c40| 77 6f 20 74 6f 20 39 39 | 20 64 65 63 69 6d 61 6c |wo to 99| decimal|
|00002c50| 20 70 6c 61 63 65 73 2e | 0a 58 20 20 4e 6f 20 64 | places.|.X No d|
|00002c60| 6f 75 62 74 2c 20 77 65 | 20 77 69 6c 6c 20 62 65 |oubt, we| will be|
|00002c70| 20 61 64 64 69 6e 67 20 | 74 65 73 74 73 20 74 6f | adding |tests to|
|00002c80| 20 74 68 69 73 20 73 75 | 69 74 65 20 61 73 20 77 | this su|ite as w|
|00002c90| 65 20 73 65 65 20 74 68 | 65 20 6e 65 65 64 20 74 |e see th|e need t|
|00002ca0| 6f 20 74 65 73 74 0a 58 | 61 6e 64 20 65 76 61 6c |o test.X|and eval|
|00002cb0| 75 61 74 65 20 66 72 6f | 6d 20 64 69 66 66 65 72 |uate fro|m differ|
|00002cc0| 65 6e 74 20 70 65 72 73 | 70 65 63 74 69 76 65 73 |ent pers|pectives|
|00002cd0| 2e 0a 58 0a 58 21 53 55 | 42 48 45 44 21 50 72 6f |..X.X!SU|BHED!Pro|
|00002ce0| 62 6c 65 6d 73 20 69 6e | 20 74 68 65 20 4d 6f 64 |blems in| the Mod|
|00002cf0| 65 72 6e 20 57 6f 72 6c | 64 21 45 4e 44 53 55 42 |ern Worl|d!ENDSUB|
|00002d00| 48 45 44 21 0a 58 54 68 | 65 20 6d 61 6a 6f 72 20 |HED!.XTh|e major |
|00002d10| 70 72 6f 62 6c 65 6d 20 | 77 65 20 68 61 76 65 20 |problem |we have |
|00002d20| 68 61 64 20 77 69 74 68 | 20 64 65 76 65 6c 6f 70 |had with| develop|
|00002d30| 69 6e 67 20 74 68 65 20 | 55 4e 49 58 20 62 65 6e |ing the |UNIX ben|
|00002d40| 63 68 6d 61 72 6b 20 70 | 72 6f 67 72 61 6d 73 20 |chmark p|rograms |
|00002d50| 69 73 0a 58 64 65 73 69 | 67 6e 69 6e 67 20 74 68 |is.Xdesi|gning th|
|00002d60| 65 6d 20 73 6f 20 74 68 | 61 74 20 74 68 65 79 20 |em so th|at they |
|00002d70| 66 61 69 72 6c 79 20 72 | 65 66 6c 65 63 74 20 74 |fairly r|eflect t|
|00002d80| 68 65 20 73 74 72 65 6e | 67 74 68 73 20 61 6e 64 |he stren|gths and|
|00002d90| 20 77 65 61 6b 6e 65 73 | 73 65 73 20 6f 66 0a 58 | weaknes|ses of.X|
|00002da0| 61 6c 6c 20 74 68 65 20 | 73 79 73 74 65 6d 73 20 |all the |systems |
|00002db0| 6f 6e 20 77 68 69 63 68 | 20 77 65 20 61 6e 74 69 |on which| we anti|
|00002dc0| 63 69 70 61 74 65 20 75 | 73 69 6e 67 20 74 68 65 |cipate u|sing the|
|00002dd0| 6d 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 20 |m. For e|xample, |
|00002de0| 74 68 65 0a 58 6f 70 65 | 72 61 74 69 6f 6e 73 20 |the.Xope|rations |
|00002df0| 73 68 6f 75 6c 64 20 61 | 6c 6c 6f 77 20 52 49 53 |should a|llow RIS|
|00002e00| 43 20 6d 61 63 68 69 6e | 65 73 20 74 6f 20 67 69 |C machin|es to gi|
|00002e10| 76 65 20 61 70 70 72 6f | 70 72 69 61 74 65 6c 79 |ve appro|priately|
|00002e20| 20 68 69 67 68 20 70 65 | 72 66 6f 72 6d 61 6e 63 | high pe|rformanc|
|00002e30| 65 0a 58 66 6f 72 20 74 | 68 65 20 73 6f 72 74 73 |e.Xfor t|he sorts|
|00002e40| 20 6f 66 20 6f 70 65 72 | 61 74 69 6f 6e 73 20 74 | of oper|ations t|
|00002e50| 68 61 74 20 52 49 53 43 | 20 69 73 20 67 6f 6f 64 |hat RISC| is good|
|00002e60| 20 66 6f 72 2c 20 61 6e | 64 20 73 68 6f 75 6c 64 | for, an|d should|
|00002e70| 20 61 6c 73 6f 20 69 6c | 6c 75 73 74 72 61 74 65 | also il|lustrate|
|00002e80| 0a 58 69 6d 70 72 6f 76 | 65 6d 65 6e 74 73 20 70 |.Ximprov|ements p|
|00002e90| 72 6f 76 69 64 65 64 20 | 62 79 20 66 61 73 74 65 |rovided |by faste|
|00002ea0| 72 20 62 75 73 20 73 70 | 65 65 64 73 2c 20 62 65 |r bus sp|eeds, be|
|00002eb0| 74 74 65 72 20 6d 61 74 | 68 20 63 6f 70 72 6f 63 |tter mat|h coproc|
|00002ec0| 65 73 73 6f 72 73 20 61 | 6e 64 20 74 68 65 0a 58 |essors a|nd the.X|
|00002ed0| 6c 69 6b 65 2e 20 49 6e | 20 74 68 65 20 63 61 73 |like. In| the cas|
|00002ee0| 65 20 6f 66 20 52 49 53 | 43 2c 20 74 68 65 20 65 |e of RIS|C, the e|
|00002ef0| 66 66 69 63 69 65 6e 63 | 79 20 6f 66 20 74 68 65 |fficienc|y of the|
|00002f00| 20 63 6f 6d 70 69 6c 65 | 72 20 69 73 20 6f 66 20 | compile|r is of |
|00002f10| 75 74 6d 6f 73 74 0a 58 | 69 6d 70 6f 72 74 61 6e |utmost.X|importan|
|00002f20| 63 65 3b 20 52 49 53 43 | 20 63 6f 6d 70 69 6c 65 |ce; RISC| compile|
|00002f30| 72 73 20 6d 75 73 74 20 | 72 65 61 72 72 61 6e 67 |rs must |rearrang|
|00002f40| 65 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 20 74 |e instru|ctions t|
|00002f50| 6f 20 74 61 6b 65 20 61 | 64 76 61 6e 74 61 67 65 |o take a|dvantage|
|00002f60| 20 6f 66 0a 58 69 6e 73 | 74 72 75 63 74 69 6f 6e | of.Xins|truction|
|00002f70| 20 70 69 70 65 6c 69 6e | 69 6e 67 20 28 66 6f 72 | pipelin|ing (for|
|00002f80| 20 61 6e 20 6f 76 65 72 | 76 69 65 77 20 6f 66 20 | an over|view of |
|00002f90| 52 49 53 43 2c 20 73 65 | 65 20 42 59 54 45 2c 20 |RISC, se|e BYTE, |
|00002fa0| 4d 61 79 20 31 39 38 38 | 29 2e 0a 58 20 20 54 68 |May 1988|)..X Th|
|00002fb0| 65 20 6d 61 6a 6f 72 69 | 74 79 20 6f 66 20 74 68 |e majori|ty of th|
|00002fc0| 65 20 55 4e 49 58 20 73 | 79 73 74 65 6d 73 20 74 |e UNIX s|ystems t|
|00002fd0| 68 61 74 20 77 65 20 6c | 6f 6f 6b 20 61 74 20 65 |hat we l|ook at e|
|00002fe0| 6d 70 6c 6f 79 20 64 69 | 73 6b 20 63 61 63 68 69 |mploy di|sk cachi|
|00002ff0| 6e 67 2e 20 54 68 69 73 | 0a 58 69 73 20 65 73 70 |ng. This|.Xis esp|
|00003000| 65 63 69 61 6c 6c 79 20 | 69 6d 70 6f 72 74 61 6e |ecially |importan|
|00003010| 74 20 62 65 63 61 75 73 | 65 20 6d 6f 64 65 72 6e |t becaus|e modern|
|00003020| 20 55 4e 49 58 20 69 6e | 63 6c 75 64 65 73 20 73 | UNIX in|cludes s|
|00003030| 77 61 70 70 69 6e 67 20 | 61 6e 64 20 70 61 67 69 |wapping |and pagi|
|00003040| 6e 67 20 6f 75 74 0a 58 | 74 6f 20 64 69 73 6b 20 |ng out.X|to disk |
|00003050| 77 68 65 6e 20 74 68 65 | 72 65 20 69 73 20 69 6e |when the|re is in|
|00003060| 73 75 66 66 69 63 69 65 | 6e 74 20 6d 65 6d 6f 72 |sufficie|nt memor|
|00003070| 79 20 66 6f 72 20 61 20 | 74 61 73 6b 20 6f 72 20 |y for a |task or |
|00003080| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 74 61 |the numb|er of ta|
|00003090| 73 6b 73 2e 0a 58 49 74 | 20 69 73 20 61 6e 20 69 |sks..XIt| is an i|
|000030a0| 6e 74 65 72 65 73 74 69 | 6e 67 20 65 78 65 72 63 |nteresti|ng exerc|
|000030b0| 69 73 65 20 74 6f 20 72 | 75 6e 20 74 68 65 20 64 |ise to r|un the d|
|000030c0| 69 73 6b 20 66 69 6c 65 | 20 6f 70 65 72 61 74 69 |isk file| operati|
|000030d0| 6f 6e 73 20 74 65 73 74 | 20 77 69 74 68 0a 58 69 |ons test| with.Xi|
|000030e0| 6e 63 72 65 61 73 69 6e | 67 6c 79 20 6c 61 72 67 |ncreasin|gly larg|
|000030f0| 65 20 66 69 6c 65 73 20 | 61 6e 64 20 6e 6f 74 65 |e files |and note|
|00003100| 20 74 68 65 20 70 6f 69 | 6e 74 20 61 74 20 77 68 | the poi|nt at wh|
|00003110| 69 63 68 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |ich perf|ormance |
|00003120| 64 72 6f 70 73 2e 0a 58 | 0a 58 21 53 55 42 48 45 |drops..X|.X!SUBHE|
|00003130| 44 21 48 6f 77 20 54 68 | 65 79 20 57 6f 72 6b 21 |D!How Th|ey Work!|
|00003140| 45 4e 44 53 55 42 48 45 | 44 21 0a 58 41 20 34 30 |ENDSUBHE|D!.XA 40|
|00003150| 30 20 6c 69 6e 65 20 42 | 6f 75 72 6e 65 20 73 68 |0 line B|ourne sh|
|00003160| 65 6c 6c 20 73 63 72 69 | 70 74 20 28 21 4d 4f 4e |ell scri|pt (!MON|
|00003170| 4f 21 52 75 6e 21 45 4e | 44 4d 4f 4e 4f 21 29 20 |O!Run!EN|DMONO!) |
|00003180| 61 64 6d 69 6e 69 73 74 | 65 72 73 20 74 68 65 0a |administ|ers the.|
|00003190| 58 62 65 6e 63 68 6d 61 | 72 6b 69 6e 67 20 73 79 |Xbenchma|rking sy|
|000031a0| 73 74 65 6d 2e 20 41 66 | 74 65 72 20 74 68 65 20 |stem. Af|ter the |
|000031b0| 65 76 61 6c 75 61 74 69 | 6f 6e 20 6f 66 20 74 68 |evaluati|on of th|
|000031c0| 65 20 63 6f 6d 6d 61 6e | 64 20 6c 69 6e 65 20 6f |e comman|d line o|
|000031d0| 70 74 69 6f 6e 73 2c 20 | 74 68 65 0a 58 62 65 6e |ptions, |the.Xben|
|000031e0| 63 68 6d 61 72 6b 69 6e | 67 20 6f 70 65 72 61 74 |chmarkin|g operat|
|000031f0| 69 6f 6e 20 66 6f 72 20 | 65 61 63 68 20 74 65 73 |ion for |each tes|
|00003200| 74 20 68 61 73 20 74 68 | 72 65 65 20 73 74 61 67 |t has th|ree stag|
|00003210| 65 73 3a 20 70 61 72 61 | 6d 65 74 65 72 20 73 65 |es: para|meter se|
|00003220| 74 75 70 2c 0a 58 74 69 | 6d 69 6e 67 20 74 68 65 |tup,.Xti|ming the|
|00003230| 20 65 78 65 63 75 74 69 | 6f 6e 20 6f 66 20 74 68 | executi|on of th|
|00003240| 65 20 74 65 73 74 2c 20 | 61 6e 64 20 63 61 6c 63 |e test, |and calc|
|00003250| 75 6c 61 74 69 6f 6e 2f | 66 6f 72 6d 61 74 74 69 |ulation/|formatti|
|00003260| 6e 67 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 28 73 |ng opera|tions (s|
|00003270| 65 65 0a 58 46 69 67 75 | 72 65 20 31 29 2e 20 41 |ee.XFigu|re 1). A|
|00003280| 66 74 65 72 20 21 4d 4f | 4e 4f 21 52 75 6e 21 45 |fter !MO|NO!Run!E|
|00003290| 4e 44 4d 4f 4e 4f 21 20 | 64 65 74 65 72 6d 69 6e |NDMONO! |determin|
|000032a0| 65 73 20 74 68 65 20 70 | 61 72 61 6d 65 74 65 72 |es the p|arameter|
|000032b0| 73 20 66 6f 72 20 74 68 | 65 20 74 65 73 74 2c 0a |s for th|e test,.|
|000032c0| 58 69 74 20 73 65 6e 64 | 73 20 61 20 66 6f 72 6d |Xit send|s a form|
|000032d0| 61 74 74 65 64 20 64 65 | 73 63 72 69 70 74 69 6f |atted de|scriptio|
|000032e0| 6e 20 74 6f 20 74 68 65 | 20 6f 75 74 70 75 74 20 |n to the| output |
|000032f0| 66 69 6c 65 2e 20 21 4d | 4f 4e 4f 21 52 75 6e 21 |file. !M|ONO!Run!|
|00003300| 45 4e 44 4d 4f 4e 4f 21 | 20 74 68 65 6e 0a 58 69 |ENDMONO!| then.Xi|
|00003310| 6e 76 6f 6b 65 73 20 74 | 68 65 20 73 70 65 63 69 |nvokes t|he speci|
|00003320| 66 69 63 20 74 65 73 74 | 20 62 79 20 6d 65 61 6e |fic test| by mean|
|00003330| 73 20 6f 66 20 74 68 65 | 20 55 4e 49 58 20 63 6f |s of the| UNIX co|
|00003340| 6d 6d 61 6e 64 20 21 4d | 4f 4e 4f 21 74 69 6d 65 |mmand !M|ONO!time|
|00003350| 21 45 4e 44 4d 4f 4e 4f | 21 2e 0a 58 54 68 65 20 |!ENDMONO|!..XThe |
|00003360| 6f 75 74 70 75 74 20 6f | 66 20 21 4d 4f 4e 4f 21 |output o|f !MONO!|
|00003370| 74 69 6d 65 21 45 4e 44 | 4d 4f 4e 4f 21 20 61 6e |time!END|MONO! an|
|00003380| 64 20 61 6e 79 20 6f 75 | 74 70 75 74 20 66 72 6f |d any ou|tput fro|
|00003390| 6d 20 74 68 65 20 74 65 | 73 74 20 69 74 73 65 6c |m the te|st itsel|
|000033a0| 66 20 65 6e 64 20 75 70 | 0a 58 69 6e 20 61 20 72 |f end up|.Xin a r|
|000033b0| 61 77 20 64 61 74 61 20 | 66 69 6c 65 2e 20 4d 6f |aw data |file. Mo|
|000033c0| 73 74 20 74 65 73 74 73 | 20 61 72 65 20 72 75 6e |st tests| are run|
|000033d0| 20 73 69 78 20 74 69 6d | 65 73 20 73 6f 20 74 68 | six tim|es so th|
|000033e0| 61 74 20 61 6e 79 20 76 | 61 72 69 61 6e 63 65 20 |at any v|ariance |
|000033f0| 63 61 6e 20 62 65 0a 58 | 61 76 65 72 61 67 65 64 |can be.X|averaged|
|00003400| 2e 20 4f 6e 20 63 6f 6d | 70 6c 65 74 69 6f 6e 20 |. On com|pletion |
|00003410| 6f 66 20 61 20 73 65 74 | 20 6f 66 20 74 65 73 74 |of a set| of test|
|00003420| 73 2c 20 21 4d 4f 4e 4f | 21 52 75 6e 21 45 4e 44 |s, !MONO|!Run!END|
|00003430| 4d 4f 4e 4f 21 20 69 6e | 76 6f 6b 65 73 20 61 0a |MONO! in|vokes a.|
|00003440| 58 63 6c 65 61 6e 75 70 | 20 73 63 72 69 70 74 2c |Xcleanup| script,|
|00003450| 20 77 68 69 63 68 20 64 | 6f 65 73 20 74 68 65 20 | which d|oes the |
|00003460| 73 74 61 74 69 73 74 69 | 63 61 6c 20 63 61 6c 63 |statisti|cal calc|
|00003470| 75 6c 61 74 69 6f 6e 73 | 20 6f 6e 20 74 68 65 20 |ulations| on the |
|00003480| 72 61 77 20 64 61 74 61 | 20 75 73 69 6e 67 0a 58 |raw data| using.X|
|00003490| 74 68 65 20 21 4d 4f 4e | 4f 21 61 77 6b 21 45 4e |the !MON|O!awk!EN|
|000034a0| 44 4d 4f 4e 4f 21 20 66 | 6f 72 6d 61 74 74 69 6e |DMONO! f|ormattin|
|000034b0| 67 20 6c 61 6e 67 75 61 | 67 65 2e 0a 58 20 20 54 |g langua|ge..X T|
|000034c0| 68 65 20 67 72 65 61 74 | 65 72 20 70 61 72 74 20 |he great|er part |
|000034d0| 6f 66 20 74 68 65 20 62 | 65 6e 63 68 6d 61 72 6b |of the b|enchmark|
|000034e0| 20 70 72 6f 67 72 61 6d | 73 20 61 72 65 20 77 72 | program|s are wr|
|000034f0| 69 74 74 65 6e 20 69 6e | 20 43 20 61 6e 64 20 61 |itten in| C and a|
|00003500| 72 65 0a 58 63 6f 6d 70 | 69 6c 65 64 20 6f 6e 20 |re.Xcomp|iled on |
|00003510| 74 68 65 20 74 65 73 74 | 20 6d 61 63 68 69 6e 65 |the test| machine|
|00003520| 20 70 72 69 6f 72 20 74 | 6f 20 72 75 6e 6e 69 6e | prior t|o runnin|
|00003530| 67 20 74 68 65 20 74 65 | 73 74 73 2e 20 0a 58 0a |g the te|sts. .X.|
|00003540| 58 21 53 55 42 48 45 44 | 21 55 73 69 6e 67 20 74 |X!SUBHED|!Using t|
|00003550| 68 65 20 52 65 73 75 6c | 74 73 21 45 4e 44 53 55 |he Resul|ts!ENDSU|
|00003560| 42 48 45 44 21 0a 58 49 | 66 20 61 6c 6c 20 79 6f |BHED!.XI|f all yo|
|00003570| 75 20 6e 65 65 64 20 69 | 73 20 61 20 72 61 77 20 |u need i|s a raw |
|00003580| 6d 65 61 73 75 72 65 20 | 6f 66 20 70 65 72 66 6f |measure |of perfo|
|00003590| 72 6d 61 6e 63 65 2c 20 | 74 68 65 6e 20 66 65 65 |rmance, |then fee|
|000035a0| 6c 20 66 72 65 65 20 74 | 6f 20 75 73 65 20 74 68 |l free t|o use th|
|000035b0| 65 0a 58 44 68 72 79 73 | 74 6f 6e 65 20 61 6e 64 |e.XDhrys|tone and|
|000035c0| 20 57 68 65 74 73 74 6f | 6e 65 20 74 65 73 74 73 | Whetsto|ne tests|
|000035d0| 20 61 73 20 69 6e 64 69 | 63 65 73 20 6f 66 20 6a | as indi|ces of j|
|000035e0| 75 73 74 20 74 68 61 74 | 2e 20 42 75 74 20 69 66 |ust that|. But if|
|000035f0| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 20 75 73 65 | you wan|t to use|
|00003600| 0a 58 74 68 65 20 62 65 | 6e 63 68 6d 61 72 6b 73 |.Xthe be|nchmarks|
|00003610| 20 74 6f 20 65 76 61 6c | 75 61 74 65 20 61 20 6d | to eval|uate a m|
|00003620| 61 63 68 69 6e 65 27 73 | 20 61 62 69 6c 69 74 79 |achine's| ability|
|00003630| 20 74 6f 20 73 65 72 76 | 65 20 73 6f 6d 65 20 72 | to serv|e some r|
|00003640| 65 61 6c 20 6e 65 65 64 | 2c 20 74 68 65 6e 0a 58 |eal need|, then.X|
|00003650| 79 6f 75 20 73 68 6f 75 | 6c 64 20 64 6f 20 74 68 |you shou|ld do th|
|00003660| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 3a 0a 58 31 2e |e follow|ing:.X1.|
|00003670| 20 41 6e 61 6c 79 7a 65 | 20 79 6f 75 72 20 72 65 | Analyze| your re|
|00003680| 71 75 69 72 65 6d 65 6e | 74 73 20 61 73 20 66 61 |quiremen|ts as fa|
|00003690| 72 20 61 73 20 74 68 65 | 20 74 79 70 65 20 6f 66 |r as the| type of|
|000036a0| 20 63 6f 6d 70 75 74 69 | 6e 67 2c 20 61 6d 6f 75 | computi|ng, amou|
|000036b0| 6e 74 20 61 6e 64 20 74 | 79 70 65 0a 58 6f 66 20 |nt and t|ype.Xof |
|000036c0| 63 6f 6d 6d 75 6e 69 63 | 61 74 69 6f 6e 73 20 49 |communic|ations I|
|000036d0| 2f 4f 2c 20 61 6e 64 20 | 61 6d 6f 75 6e 74 20 61 |/O, and |amount a|
|000036e0| 6e 64 20 74 79 70 65 20 | 6f 66 20 64 69 73 6b 20 |nd type |of disk |
|000036f0| 49 2f 4f 2e 0a 58 32 2e | 20 53 63 6f 72 65 20 74 |I/O..X2.| Score t|
|00003700| 68 65 20 73 75 62 6a 65 | 63 74 20 6d 61 63 68 69 |he subje|ct machi|
|00003710| 6e 65 73 20 75 73 69 6e | 67 20 77 65 69 67 68 74 |nes usin|g weight|
|00003720| 69 6e 67 20 66 61 63 74 | 6f 72 73 20 74 68 61 74 |ing fact|ors that|
|00003730| 20 72 65 66 6c 65 63 74 | 20 79 6f 75 72 0a 58 72 | reflect| your.Xr|
|00003740| 65 71 75 69 72 65 6d 65 | 6e 74 73 2e 0a 58 33 2e |equireme|nts..X3.|
|00003750| 20 47 65 6e 65 72 61 74 | 65 20 61 20 70 72 69 63 | Generat|e a pric|
|00003760| 65 20 76 73 2e 20 70 65 | 72 66 6f 72 6d 61 6e 63 |e vs. pe|rformanc|
|00003770| 65 20 70 6c 6f 74 2e 0a | 58 34 2e 20 55 73 65 20 |e plot..|X4. Use |
|00003780| 74 68 65 20 70 72 69 63 | 65 20 76 73 2e 20 70 65 |the pric|e vs. pe|
|00003790| 72 66 6f 72 6d 61 6e 63 | 65 2c 20 61 6c 6f 6e 67 |rformanc|e, along|
|000037a0| 20 77 69 74 68 20 69 6e | 66 6f 72 6d 61 74 69 6f | with in|formatio|
|000037b0| 6e 20 61 62 6f 75 74 20 | 74 68 65 0a 58 72 65 6c |n about |the.Xrel|
|000037c0| 69 61 62 69 6c 69 74 79 | 20 73 65 72 76 69 63 61 |iability| servica|
|000037d0| 62 69 6c 69 74 79 20 6f | 66 20 74 68 65 20 68 61 |bility o|f the ha|
|000037e0| 72 64 77 61 72 65 2e 0a | 58 20 20 53 74 65 70 20 |rdware..|X Step |
|000037f0| 34 20 69 73 20 72 65 61 | 6c 6c 79 20 6d 6f 72 65 |4 is rea|lly more|
|00003800| 20 6f 66 20 61 6e 20 61 | 72 74 20 74 68 61 6e 20 | of an a|rt than |
|00003810| 61 6e 79 74 68 69 6e 67 | 20 65 6c 73 65 2e 20 49 |anything| else. I|
|00003820| 74 20 69 73 20 65 78 74 | 72 65 6d 65 6c 79 0a 58 |t is ext|remely.X|
|00003830| 69 6d 70 6f 72 74 61 6e | 74 2c 20 68 6f 77 65 76 |importan|t, howev|
|00003840| 65 72 2c 20 74 6f 20 6e | 6f 74 20 72 65 6c 79 20 |er, to n|ot rely |
|00003850| 6f 6e 20 70 72 69 63 65 | 20 76 73 2e 20 70 65 72 |on price| vs. per|
|00003860| 66 6f 72 6d 61 6e 63 65 | 20 61 6c 6f 6e 65 2e 0a |formance| alone..|
|00003870| 58 20 57 65 20 75 73 65 | 20 6f 75 72 20 55 4e 49 |X We use| our UNI|
|00003880| 58 20 42 65 6e 63 68 6d | 61 72 6b 73 20 66 6f 72 |X Benchm|arks for|
|00003890| 20 64 6f 69 6e 67 20 61 | 20 72 6f 75 67 68 20 61 | doing a| rough a|
|000038a0| 6e 61 6c 79 73 69 73 20 | 61 6e 64 20 63 6f 6d 70 |nalysis |and comp|
|000038b0| 61 72 69 73 6f 6e 20 6f | 66 0a 58 64 69 76 65 72 |arison o|f.Xdiver|
|000038c0| 67 65 6e 74 20 6d 61 63 | 68 69 6e 65 73 2e 20 28 |gent mac|hines. (|
|000038d0| 53 65 65 20 66 69 67 75 | 72 65 20 32 2c 20 60 60 |See figu|re 2, ``|
|000038e0| 55 4e 49 58 20 4d 61 63 | 68 69 6e 65 73 20 54 65 |UNIX Mac|hines Te|
|000038f0| 73 74 65 64 2e 27 27 29 | 20 41 73 20 79 6f 75 20 |sted.'')| As you |
|00003900| 63 61 6e 20 73 65 65 2c | 0a 58 77 65 20 65 76 65 |can see,|.Xwe eve|
|00003910| 6e 20 67 6f 20 73 6f 20 | 66 61 72 20 61 73 20 74 |n go so |far as t|
|00003920| 6f 20 67 65 6e 65 72 61 | 74 65 20 61 20 73 69 6e |o genera|te a sin|
|00003930| 67 6c 65 20 69 6e 64 65 | 78 20 6e 75 6d 62 65 72 |gle inde|x number|
|00003940| 2c 20 61 20 73 6f 72 74 | 20 6f 66 20 72 65 64 75 |, a sort| of redu|
|00003950| 63 74 69 6f 6e 0a 58 6f | 66 20 61 6c 6c 20 6f 66 |ction.Xo|f all of|
|00003960| 20 74 68 65 20 62 65 6e | 63 68 6d 61 72 6b 20 74 | the ben|chmark t|
|00003970| 65 73 74 73 20 74 6f 20 | 61 20 73 69 6e 67 6c 65 |ests to |a single|
|00003980| 20 76 61 6c 75 65 2e 20 | 54 68 69 73 20 69 6e 64 | value. |This ind|
|00003990| 65 78 20 69 73 20 67 65 | 6e 65 72 61 74 65 64 20 |ex is ge|nerated |
|000039a0| 62 79 0a 58 73 75 6d 6d | 69 6e 67 20 74 68 65 20 |by.Xsumm|ing the |
|000039b0| 74 68 65 20 69 6e 64 69 | 76 69 64 75 61 6c 20 69 |the indi|vidual i|
|000039c0| 6e 64 69 63 65 73 20 6f | 66 20 74 68 65 20 64 68 |ndices o|f the dh|
|000039d0| 72 79 73 74 6f 6e 65 20 | 74 65 73 74 2c 20 74 68 |rystone |test, th|
|000039e0| 65 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |e floati|ng point|
|000039f0| 0a 58 74 65 73 74 2c 20 | 74 68 65 20 73 68 65 6c |.Xtest, |the shel|
|00003a00| 6c 20 74 65 73 74 20 77 | 69 74 68 20 65 69 67 68 |l test w|ith eigh|
|00003a10| 74 20 63 6f 6e 63 75 72 | 72 65 6e 74 20 70 72 6f |t concur|rent pro|
|00003a20| 63 65 73 73 65 73 2c 20 | 74 68 65 20 43 20 63 6f |cesses, |the C co|
|00003a30| 6d 70 69 6c 65 72 20 74 | 69 6d 65 2c 0a 58 74 68 |mpiler t|ime,.Xth|
|00003a40| 65 20 21 4d 4f 4e 4f 21 | 64 63 21 45 4e 44 4d 4f |e !MONO!|dc!ENDMO|
|00003a50| 4e 4f 21 20 72 6f 75 74 | 69 6e 65 2c 20 61 6e 64 |NO! rout|ine, and|
|00003a60| 20 74 68 65 20 74 6f 77 | 65 72 20 6f 66 20 68 61 | the tow|er of ha|
|00003a70| 6e 6f 69 20 74 69 6d 65 | 2e 20 42 79 20 64 65 66 |noi time|. By def|
|00003a80| 69 6e 69 74 69 6f 6e 2c | 0a 58 74 68 65 20 63 6f |inition,|.Xthe co|
|00003a90| 6d 62 69 6e 65 64 20 69 | 6e 64 65 78 20 66 6f 72 |mbined i|ndex for|
|00003aa0| 20 74 68 65 20 62 61 73 | 65 6c 69 6e 65 20 6d 61 | the bas|eline ma|
|00003ab0| 63 68 69 6e 65 20 69 73 | 20 73 69 78 2e 20 49 6e |chine is| six. In|
|00003ac0| 64 69 63 65 73 73 20 61 | 62 6f 76 65 20 73 69 78 |dicess a|bove six|
|00003ad0| 20 69 6d 70 6c 79 0a 58 | 61 20 62 65 74 74 65 72 | imply.X|a better|
|00003ae0| 20 6f 76 65 72 61 6c 6c | 20 70 65 72 66 6f 72 6d | overall| perform|
|00003af0| 61 6e 63 65 20 74 68 61 | 6e 20 74 68 65 20 62 61 |ance tha|n the ba|
|00003b00| 73 65 6c 69 6e 65 20 6d | 61 63 68 69 6e 65 3b 20 |seline m|achine; |
|00003b10| 69 6e 64 69 63 65 73 20 | 6c 65 73 73 20 74 68 61 |indices |less tha|
|00003b20| 6e 0a 58 73 69 78 2c 20 | 77 6f 72 73 65 20 70 65 |n.Xsix, |worse pe|
|00003b30| 72 66 6f 72 6d 61 6e 63 | 65 2e 20 41 6c 77 61 79 |rformanc|e. Alway|
|00003b40| 73 20 6b 65 65 70 20 69 | 6e 20 6d 69 6e 64 20 74 |s keep i|n mind t|
|00003b50| 68 61 74 20 68 61 76 69 | 6e 67 20 61 20 73 69 6e |hat havi|ng a sin|
|00003b60| 67 6c 65 20 69 6e 64 65 | 78 20 72 61 74 69 6e 67 |gle inde|x rating|
|00003b70| 0a 58 66 6f 72 20 61 20 | 6d 61 63 68 69 6e 65 20 |.Xfor a |machine |
|00003b80| 6d 61 79 20 6d 61 6b 65 | 20 67 6f 6f 64 20 63 6f |may make| good co|
|00003b90| 63 6b 74 61 69 6c 20 63 | 6f 6e 76 65 72 73 61 74 |cktail c|onversat|
|00003ba0| 69 6f 6e 2c 20 62 75 74 | 20 69 74 20 69 73 20 69 |ion, but| it is i|
|00003bb0| 6e 63 72 65 64 69 62 6c | 79 0a 58 73 69 6d 70 6c |ncredibl|y.Xsimpl|
|00003bc0| 69 73 74 69 63 2e 20 49 | 74 20 69 73 20 6c 69 6b |istic. I|t is lik|
|00003bd0| 65 20 72 65 64 75 63 69 | 6e 67 20 61 20 63 6f 6d |e reduci|ng a com|
|00003be0| 70 6c 65 78 20 73 63 75 | 6c 70 74 75 72 61 6c 20 |plex scu|lptural |
|00003bf0| 73 68 61 70 65 20 74 6f | 20 61 20 73 69 6e 67 6c |shape to| a singl|
|00003c00| 65 20 70 6f 69 6e 74 3b | 0a 58 79 6f 75 20 6e 6f |e point;|.Xyou no|
|00003c10| 20 6c 6f 6e 67 65 72 20 | 63 61 6e 20 74 65 6c 6c | longer |can tell|
|00003c20| 20 77 68 61 74 20 79 6f | 75 20 61 72 65 20 6c 6f | what yo|u are lo|
|00003c30| 6f 6b 69 6e 67 20 61 74 | 2e 20 54 68 69 73 20 6e |oking at|. This n|
|00003c40| 75 6d 62 65 72 20 64 6f | 65 73 6e 27 74 20 72 65 |umber do|esn't re|
|00003c50| 66 6c 65 63 74 0a 58 61 | 6e 79 20 72 65 61 6c 2d |flect.Xa|ny real-|
|00003c60| 77 6f 72 6c 64 20 75 73 | 65 20 6f 66 20 61 20 55 |world us|e of a U|
|00003c70| 4e 49 58 20 73 79 73 74 | 65 6d 2e 20 48 6f 77 65 |NIX syst|em. Howe|
|00003c80| 76 65 72 2c 20 74 68 65 | 20 69 6e 64 65 78 20 69 |ver, the| index i|
|00003c90| 73 20 64 65 76 69 73 65 | 64 20 73 6f 20 74 68 61 |s devise|d so tha|
|00003ca0| 74 20 69 74 0a 58 67 69 | 76 65 73 20 61 6e 20 6f |t it.Xgi|ves an o|
|00003cb0| 76 65 72 61 6c 6c 20 69 | 6e 64 69 63 61 74 69 6f |verall i|ndicatio|
|00003cc0| 6e 20 6f 66 20 64 69 66 | 66 65 72 65 6e 74 20 6b |n of dif|ferent k|
|00003cd0| 69 6e 64 73 20 6f 66 20 | 73 79 73 74 65 6d 20 6f |inds of |system o|
|00003ce0| 70 65 72 61 74 69 6f 6e | 73 20 61 6e 64 20 73 6f |peration|s and so|
|00003cf0| 20 69 73 0a 58 76 61 6c | 75 61 62 6c 65 20 74 6f | is.Xval|uable to|
|00003d00| 20 6f 75 72 20 72 65 76 | 69 65 77 73 2e 0a 58 20 | our rev|iews..X |
|00003d10| 20 42 59 54 45 27 73 20 | 55 4e 49 58 20 62 65 6e | BYTE's |UNIX ben|
|00003d20| 63 68 6d 61 72 6b 69 6e | 67 20 73 75 69 74 65 20 |chmarkin|g suite |
|00003d30| 69 73 20 73 6d 61 6c 6c | 20 65 6e 6f 75 67 68 20 |is small| enough |
|00003d40| 74 6f 20 70 6f 72 74 20 | 65 61 73 69 6c 79 20 74 |to port |easily t|
|00003d50| 6f 20 61 6e 79 20 55 4e | 49 58 0a 58 73 79 73 74 |o any UN|IX.Xsyst|
|00003d60| 65 6d 2c 20 79 65 74 20 | 64 69 76 65 72 73 65 20 |em, yet |diverse |
|00003d70| 61 6e 64 20 66 6c 65 78 | 69 62 6c 65 20 65 6e 6f |and flex|ible eno|
|00003d80| 75 67 68 20 74 6f 20 62 | 65 20 75 73 65 66 75 6c |ugh to b|e useful|
|00003d90| 20 66 6f 72 20 61 20 77 | 69 64 65 20 73 70 65 63 | for a w|ide spec|
|00003da0| 74 72 75 6d 20 6f 66 0a | 58 62 65 6e 63 68 6d 61 |trum of.|Xbenchma|
|00003db0| 72 6b 69 6e 67 20 72 65 | 71 75 69 72 65 6d 65 6e |rking re|quiremen|
|00003dc0| 74 73 2e 20 42 65 73 69 | 64 65 73 2c 20 74 68 65 |ts. Besi|des, the|
|00003dd0| 79 27 72 65 20 69 6e 20 | 74 68 65 20 70 75 62 6c |y're in |the publ|
|00003de0| 69 63 20 64 6f 6d 61 69 | 6e 2c 20 73 6f 20 74 68 |ic domai|n, so th|
|00003df0| 65 79 20 63 61 6e 0a 58 | 62 65 20 6f 62 74 61 69 |ey can.X|be obtai|
|00003e00| 6e 65 64 20 66 6f 72 20 | 6c 69 74 74 6c 65 2c 20 |ned for |little, |
|00003e10| 69 66 20 61 6e 79 2c 20 | 63 6f 73 74 2e 20 57 68 |if any, |cost. Wh|
|00003e20| 61 74 20 62 65 74 74 65 | 72 20 72 65 61 73 6f 6e |at bette|r reason|
|00003e30| 20 64 6f 20 79 6f 75 20 | 6e 65 65 64 20 74 6f 20 | do you |need to |
|00003e40| 75 73 65 0a 58 74 68 65 | 6d 3f 0a 45 4e 44 5f 4f |use.Xthe|m?.END_O|
|00003e50| 46 5f 46 49 4c 45 0a 69 | 66 20 74 65 73 74 20 31 |F_FILE.i|f test 1|
|00003e60| 34 36 38 32 20 2d 6e 65 | 20 60 77 63 20 2d 63 20 |4682 -ne| `wc -c |
|00003e70| 3c 27 62 65 6e 63 68 2e | 64 6f 63 27 60 3b 20 74 |<'bench.|doc'`; t|
|00003e80| 68 65 6e 0a 20 20 20 20 | 65 63 68 6f 20 73 68 61 |hen. |echo sha|
|00003e90| 72 3a 20 5c 22 27 62 65 | 6e 63 68 2e 64 6f 63 27 |r: \"'be|nch.doc'|
|00003ea0| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00003eb0| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00003ec0| 63 68 6d 6f 64 20 2b 78 | 20 27 62 65 6e 63 68 2e |chmod +x| 'bench.|
|00003ed0| 64 6f 63 27 0a 23 20 65 | 6e 64 20 6f 66 20 27 62 |doc'.# e|nd of 'b|
|00003ee0| 65 6e 63 68 2e 64 6f 63 | 27 0a 66 69 0a 69 66 20 |ench.doc|'.fi.if |
|00003ef0| 74 65 73 74 20 2d 66 20 | 27 62 69 67 2e 63 27 20 |test -f |'big.c' |
|00003f00| 2d 61 20 22 24 7b 31 7d | 22 20 21 3d 20 22 2d 63 |-a "${1}|" != "-c|
|00003f10| 22 20 3b 20 74 68 65 6e | 20 0a 20 20 65 63 68 6f |" ; then| . echo|
|00003f20| 20 73 68 61 72 3a 20 57 | 69 6c 6c 20 6e 6f 74 20 | shar: W|ill not |
|00003f30| 63 6c 6f 62 62 65 72 20 | 65 78 69 73 74 69 6e 67 |clobber |existing|
|00003f40| 20 66 69 6c 65 20 5c 22 | 27 62 69 67 2e 63 27 5c | file \"|'big.c'\|
|00003f50| 22 0a 65 6c 73 65 0a 65 | 63 68 6f 20 73 68 61 72 |".else.e|cho shar|
|00003f60| 3a 20 45 78 74 72 61 63 | 74 69 6e 67 20 5c 22 27 |: Extrac|ting \"'|
|00003f70| 62 69 67 2e 63 27 5c 22 | 20 5c 28 31 33 37 35 30 |big.c'\"| \(13750|
|00003f80| 20 63 68 61 72 61 63 74 | 65 72 73 5c 29 0a 73 65 | charact|ers\).se|
|00003f90| 64 20 22 73 2f 5e 58 2f | 2f 22 20 3e 27 62 69 67 |d "s/^X/|/" >'big|
|00003fa0| 2e 63 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |.c' <<'E|ND_OF_FI|
|00003fb0| 4c 45 27 0a 58 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |LE'.X/**|********|
|00003fc0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003fd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003fe0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ff0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004000| 2a 2a 2a 2a 2a 0a 58 20 | 2a 20 20 54 68 65 20 42 |*****.X |* The B|
|00004010| 59 54 45 20 55 4e 49 58 | 20 42 65 6e 63 68 6d 61 |YTE UNIX| Benchma|
|00004020| 72 6b 73 20 2d 20 52 65 | 6c 65 61 73 65 20 32 0a |rks - Re|lease 2.|
|00004030| 58 20 2a 20 20 20 20 20 | 20 20 20 20 20 4d 6f 64 |X * | Mod|
|00004040| 75 6c 65 3a 20 62 69 67 | 2e 63 20 20 20 53 49 44 |ule: big|.c SID|
|00004050| 3a 20 32 2e 34 20 34 2f | 31 37 2f 39 30 20 31 36 |: 2.4 4/|17/90 16|
|00004060| 3a 34 35 3a 33 31 0a 58 | 20 2a 20 20 20 20 20 20 |:45:31.X| * |
|00004070| 20 20 20 20 0a 58 20 2a | 2a 2a 2a 2a 2a 2a 2a 2a | .X *|********|
|00004080| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040c0| 2a 2a 2a 2a 2a 2a 0a 58 | 20 2a 20 42 75 67 20 72 |******.X| * Bug r|
|000040d0| 65 70 6f 72 74 73 2c 20 | 70 61 74 63 68 65 73 2c |eports, |patches,|
|000040e0| 20 63 6f 6d 6d 65 6e 74 | 73 2c 20 73 75 67 67 65 | comment|s, sugge|
|000040f0| 73 74 69 6f 6e 73 20 73 | 68 6f 75 6c 64 20 62 65 |stions s|hould be|
|00004100| 20 73 65 6e 74 20 74 6f | 3a 0a 58 20 2a 0a 58 20 | sent to|:.X *.X |
|00004110| 2a 09 42 65 6e 20 53 6d | 69 74 68 20 6f 72 20 52 |*.Ben Sm|ith or R|
|00004120| 69 63 6b 20 47 72 65 68 | 61 6e 20 61 74 20 42 59 |ick Greh|an at BY|
|00004130| 54 45 20 4d 61 67 61 7a | 69 6e 65 0a 58 20 2a 09 |TE Magaz|ine.X *.|
|00004140| 62 65 6e 73 6d 69 74 68 | 40 62 69 78 70 62 2e 55 |bensmith|@bixpb.U|
|00004150| 55 43 50 20 20 20 20 72 | 69 63 6b 5f 67 40 62 69 |UCP r|ick_g@bi|
|00004160| 78 70 62 2e 55 55 43 50 | 0a 58 20 2a 0a 58 20 2a |xpb.UUCP|.X *.X *|
|00004170| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004180| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004190| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 58 |********|******.X|
|000041c0| 20 2a 20 20 4d 6f 64 69 | 66 69 63 61 74 69 6f 6e | * Modi|fication|
|000041d0| 20 4c 6f 67 3a 0a 58 20 | 2a 0a 58 20 2a 2a 2a 2a | Log:.X |*.X ****|
|000041e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004200| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004210| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2f 0a 58 63 68 61 |********|**/.Xcha|
|00004230| 72 20 53 43 43 53 69 64 | 5b 5d 20 3d 20 22 40 28 |r SCCSid|[] = "@(|
|00004240| 23 29 20 40 28 23 29 62 | 69 67 2e 63 3a 32 2e 34 |#) @(#)b|ig.c:2.4|
|00004250| 20 2d 2d 20 34 2f 31 37 | 2f 39 30 20 31 36 3a 34 | -- 4/17|/90 16:4|
|00004260| 35 3a 33 31 22 3b 0a 58 | 2f 2a 0a 58 20 2a 20 20 |5:31";.X|/*.X * |
|00004270| 64 75 6d 6d 79 20 63 6f | 64 65 20 66 6f 72 20 65 |dummy co|de for e|
|00004280| 78 65 63 6c 20 74 65 73 | 74 20 5b 20 6f 6c 64 20 |xecl tes|t [ old |
|00004290| 76 65 72 73 69 6f 6e 20 | 6f 66 20 6d 61 6b 65 77 |version |of makew|
|000042a0| 6f 72 6b 2e 63 20 5d 0a | 58 20 2a 0a 58 20 2a 20 |ork.c ].|X *.X * |
|000042b0| 20 6d 61 6b 65 77 6f 72 | 6b 20 5b 20 2d 72 20 72 | makewor|k [ -r r|
|000042c0| 61 74 65 20 5d 20 5b 20 | 2d 63 20 63 6f 70 79 66 |ate ] [ |-c copyf|
|000042d0| 69 6c 65 20 5d 20 6e 75 | 73 65 72 73 0a 58 20 2a |ile ] nu|sers.X *|
|000042e0| 0a 58 20 2a 20 20 6a 6f | 62 20 73 74 72 65 61 6d |.X * jo|b stream|
|000042f0| 73 20 61 72 65 20 73 70 | 65 63 69 66 69 65 64 20 |s are sp|ecified |
|00004300| 6f 6e 20 73 74 61 6e 64 | 61 72 64 20 69 6e 70 75 |on stand|ard inpu|
|00004310| 74 20 77 69 74 68 20 6c | 69 6e 65 73 20 6f 66 20 |t with l|ines of |
|00004320| 74 68 65 20 66 6f 72 6d | 0a 58 20 2a 20 20 66 75 |the form|.X * fu|
|00004330| 6c 6c 5f 70 61 74 68 5f | 6e 61 6d 65 5f 66 6f 72 |ll_path_|name_for|
|00004340| 5f 63 6f 6d 6d 61 6e 64 | 20 5b 20 6f 70 74 69 6f |_command| [ optio|
|00004350| 6e 73 20 5d 20 5b 20 3c | 73 74 61 6e 64 61 72 64 |ns ] [ <|standard|
|00004360| 5f 69 6e 70 75 74 5f 66 | 69 6c 65 20 5d 0a 58 20 |_input_f|ile ].X |
|00004370| 2a 0a 58 20 2a 20 20 22 | 73 74 61 6e 64 61 72 64 |*.X * "|standard|
|00004380| 20 69 6e 70 75 74 22 20 | 69 73 20 73 65 6e 64 20 | input" |is send |
|00004390| 74 6f 20 61 6c 6c 20 6e | 75 73 65 72 20 69 6e 73 |to all n|user ins|
|000043a0| 74 61 6e 63 65 73 20 6f | 66 20 74 68 65 20 63 6f |tances o|f the co|
|000043b0| 6d 6d 61 6e 64 73 20 69 | 6e 20 74 68 65 0a 58 20 |mmands i|n the.X |
|000043c0| 2a 20 20 6a 6f 62 20 73 | 74 72 65 61 6d 73 20 61 |* job s|treams a|
|000043d0| 74 20 61 20 72 61 74 65 | 20 6e 6f 74 20 69 6e 20 |t a rate| not in |
|000043e0| 65 78 63 65 73 73 20 6f | 66 20 22 72 61 74 65 22 |excess o|f "rate"|
|000043f0| 20 63 68 61 72 61 63 74 | 65 72 73 20 70 65 72 20 | charact|ers per |
|00004400| 73 65 63 6f 6e 64 0a 58 | 20 2a 20 20 70 65 72 20 |second.X| * per |
|00004410| 63 6f 6d 6d 61 6e 64 0a | 58 20 2a 0a 58 20 2a 2f |command.|X *.X */|
|00004420| 0a 58 0a 58 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.X.X#inc|lude <st|
|00004430| 64 69 6f 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |dio.h>.X|#include|
|00004440| 20 3c 73 69 67 6e 61 6c | 2e 68 3e 0a 58 0a 58 23 | <signal|.h>.X.X#|
|00004450| 64 65 66 69 6e 65 20 44 | 45 46 5f 52 41 54 45 09 |define D|EF_RATE.|
|00004460| 35 2e 30 0a 58 23 64 65 | 66 69 6e 65 20 47 52 41 |5.0.X#de|fine GRA|
|00004470| 4e 55 4c 45 09 09 35 0a | 58 23 64 65 66 69 6e 65 |NULE..5.|X#define|
|00004480| 20 43 48 55 4e 4b 09 09 | 36 30 0a 58 23 64 65 66 | CHUNK..|60.X#def|
|00004490| 69 6e 65 20 4d 41 58 43 | 48 49 4c 44 09 31 32 0a |ine MAXC|HILD.12.|
|000044a0| 58 23 64 65 66 69 6e 65 | 20 4d 41 58 57 4f 52 4b |X#define| MAXWORK|
|000044b0| 09 09 31 30 0a 58 0a 58 | 66 6c 6f 61 74 09 74 68 |..10.X.X|float.th|
|000044c0| 72 65 73 3b 0a 58 66 6c | 6f 61 74 09 65 73 74 5f |res;.Xfl|oat.est_|
|000044d0| 72 61 74 65 20 3d 20 44 | 45 46 5f 52 41 54 45 3b |rate = D|EF_RATE;|
|000044e0| 0a 58 69 6e 74 09 6e 75 | 73 65 72 73 3b 09 09 2f |.Xint.nu|sers;../|
|000044f0| 2a 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 6f 6e 63 |* number| of conc|
|00004500| 75 72 72 65 6e 74 20 75 | 73 65 72 73 20 74 6f 20 |urrent u|sers to |
|00004510| 62 65 20 73 69 6d 75 6c | 61 74 65 64 20 62 79 0a |be simul|ated by.|
|00004520| 58 09 09 09 20 2a 20 74 | 68 69 73 20 70 72 6f 63 |X... * t|his proc|
|00004530| 65 73 73 20 2a 2f 0a 58 | 69 6e 74 09 66 69 72 73 |ess */.X|int.firs|
|00004540| 74 75 73 65 72 3b 09 2f | 2a 20 6f 72 64 69 6e 61 |tuser;./|* ordina|
|00004550| 6c 20 69 64 65 6e 74 69 | 66 69 63 61 74 69 6f 6e |l identi|fication|
|00004560| 20 6f 66 20 66 69 72 73 | 74 20 75 73 65 72 20 66 | of firs|t user f|
|00004570| 6f 72 20 74 68 69 73 0a | 58 09 09 09 20 2a 20 70 |or this.|X... * p|
|00004580| 72 6f 63 65 73 73 20 2a | 2f 0a 58 69 6e 74 09 6e |rocess *|/.Xint.n|
|00004590| 77 6f 72 6b 20 3d 20 30 | 3b 09 2f 2a 20 6e 75 6d |work = 0|;./* num|
|000045a0| 62 65 72 20 6f 66 20 6a | 6f 62 20 73 74 72 65 61 |ber of j|ob strea|
|000045b0| 6d 73 20 2a 2f 0a 58 69 | 6e 74 09 65 78 69 74 5f |ms */.Xi|nt.exit_|
|000045c0| 73 74 61 74 75 73 20 3d | 20 30 3b 09 2f 2a 20 72 |status =| 0;./* r|
|000045d0| 65 74 75 72 6e 65 64 20 | 74 6f 20 70 61 72 65 6e |eturned |to paren|
|000045e0| 74 20 2a 2f 0a 58 69 6e | 74 09 73 69 67 70 69 70 |t */.Xin|t.sigpip|
|000045f0| 65 3b 09 2f 2a 20 70 69 | 70 65 20 77 72 69 74 65 |e;./* pi|pe write|
|00004600| 20 65 72 72 6f 72 20 66 | 6c 61 67 20 2a 2f 0a 58 | error f|lag */.X|
|00004610| 0a 58 73 74 72 75 63 74 | 20 73 74 5f 77 6f 72 6b |.Xstruct| st_work|
|00004620| 20 7b 0a 58 09 63 68 61 | 72 09 2a 63 6d 64 3b 09 | {.X.cha|r.*cmd;.|
|00004630| 09 2f 2a 20 6e 61 6d 65 | 20 6f 66 20 63 6f 6d 6d |./* name| of comm|
|00004640| 61 6e 64 20 74 6f 20 72 | 75 6e 20 2a 2f 0a 58 09 |and to r|un */.X.|
|00004650| 63 68 61 72 09 2a 2a 61 | 76 3b 09 09 2f 2a 20 61 |char.**a|v;../* a|
|00004660| 72 67 75 6d 65 6e 74 73 | 20 74 6f 20 63 6f 6d 6d |rguments| to comm|
|00004670| 61 6e 64 20 2a 2f 0a 58 | 09 63 68 61 72 09 2a 69 |and */.X|.char.*i|
|00004680| 6e 70 75 74 3b 09 09 2f | 2a 20 73 74 61 6e 64 61 |nput;../|* standa|
|00004690| 72 64 20 69 6e 70 75 74 | 20 62 75 66 66 65 72 20 |rd input| buffer |
|000046a0| 2a 2f 0a 58 09 69 6e 74 | 09 69 6e 70 73 69 7a 65 |*/.X.int|.inpsize|
|000046b0| 3b 09 2f 2a 20 73 69 7a | 65 20 6f 66 20 73 74 61 |;./* siz|e of sta|
|000046c0| 6e 64 61 72 64 20 69 6e | 70 75 74 20 62 75 66 66 |ndard in|put buff|
|000046d0| 65 72 20 2a 2f 0a 58 09 | 63 68 61 72 09 2a 6f 75 |er */.X.|char.*ou|
|000046e0| 74 66 3b 09 09 2f 2a 20 | 73 74 61 6e 64 61 72 64 |tf;../* |standard|
|000046f0| 20 6f 75 74 70 75 74 20 | 28 66 69 6c 65 6e 61 6d | output |(filenam|
|00004700| 65 29 20 2a 2f 0a 58 7d | 20 77 6f 72 6b 5b 4d 41 |e) */.X}| work[MA|
|00004710| 58 57 4f 52 4b 5d 3b 0a | 58 0a 58 73 74 72 75 63 |XWORK];.|X.Xstruc|
|00004720| 74 20 7b 0a 58 09 69 6e | 74 09 78 6d 69 74 3b 09 |t {.X.in|t.xmit;.|
|00004730| 2f 2a 20 23 20 63 68 61 | 72 61 63 74 65 72 73 20 |/* # cha|racters |
|00004740| 73 65 6e 74 20 2a 2f 0a | 58 09 63 68 61 72 09 2a |sent */.|X.char.*|
|00004750| 62 70 3b 09 2f 2a 20 73 | 74 64 20 69 6e 70 75 74 |bp;./* s|td input|
|00004760| 20 62 75 66 66 65 72 20 | 70 6f 69 6e 74 65 72 20 | buffer |pointer |
|00004770| 2a 2f 0a 58 09 69 6e 74 | 09 62 6c 65 6e 3b 09 2f |*/.X.int|.blen;./|
|00004780| 2a 20 73 74 64 20 69 6e | 70 75 74 20 62 75 66 66 |* std in|put buff|
|00004790| 65 72 20 6c 65 6e 67 74 | 68 20 2a 2f 0a 58 09 69 |er lengt|h */.X.i|
|000047a0| 6e 74 09 66 64 3b 09 2f | 2a 20 73 74 64 69 6e 20 |nt.fd;./|* stdin |
|000047b0| 74 6f 20 63 6f 6d 6d 61 | 6e 64 20 2a 2f 0a 58 09 |to comma|nd */.X.|
|000047c0| 69 6e 74 09 70 69 64 3b | 09 2f 2a 20 63 68 69 6c |int.pid;|./* chil|
|000047d0| 64 20 50 49 44 20 2a 2f | 0a 58 09 63 68 61 72 09 |d PID */|.X.char.|
|000047e0| 2a 6c 69 6e 65 3b 09 2f | 2a 20 73 74 61 72 74 20 |*line;./|* start |
|000047f0| 6f 66 20 69 6e 70 75 74 | 20 6c 69 6e 65 20 2a 2f |of input| line */|
|00004800| 20 0a 58 09 69 6e 74 09 | 66 69 72 73 74 6a 6f 62 | .X.int.|firstjob|
|00004810| 3b 09 2f 2a 20 69 6e 69 | 74 61 6c 20 70 69 65 63 |;./* ini|tal piec|
|00004820| 65 20 6f 66 20 77 6f 72 | 6b 20 2a 2f 0a 58 09 69 |e of wor|k */.X.i|
|00004830| 6e 74 09 74 68 69 73 6a | 6f 62 3b 09 2f 2a 20 63 |nt.thisj|ob;./* c|
|00004840| 75 72 72 65 6e 74 20 70 | 69 65 63 65 20 6f 66 20 |urrent p|iece of |
|00004850| 77 6f 72 6b 20 2a 2f 0a | 58 7d 20 63 68 69 6c 64 |work */.|X} child|
|00004860| 5b 4d 41 58 43 48 49 4c | 44 5d 2c 20 2a 63 70 3b |[MAXCHIL|D], *cp;|
|00004870| 0a 58 0a 58 6d 61 69 6e | 28 61 72 67 63 2c 20 61 |.X.Xmain|(argc, a|
|00004880| 72 67 76 29 0a 58 69 6e | 74 09 61 72 67 63 3b 0a |rgv).Xin|t.argc;.|
|00004890| 58 63 68 61 72 09 2a 61 | 72 67 76 5b 5d 3b 0a 58 |Xchar.*a|rgv[];.X|
|000048a0| 7b 0a 58 20 20 20 20 69 | 6e 74 09 09 69 3b 0a 58 |{.X i|nt..i;.X|
|000048b0| 20 20 20 20 69 6e 74 09 | 09 6c 3b 0a 58 20 20 20 | int.|.l;.X |
|000048c0| 20 69 6e 74 09 09 66 63 | 6f 70 79 20 3d 20 30 3b | int..fc|opy = 0;|
|000048d0| 09 2f 2a 20 66 64 20 66 | 6f 72 20 63 6f 70 79 20 |./* fd f|or copy |
|000048e0| 6f 75 74 70 75 74 20 2a | 2f 0a 58 20 20 20 20 69 |output *|/.X i|
|000048f0| 6e 74 09 09 6d 61 73 74 | 65 72 20 3d 20 31 3b 09 |nt..mast|er = 1;.|
|00004900| 2f 2a 20 74 68 65 20 52 | 45 41 4c 20 6d 61 73 74 |/* the R|EAL mast|
|00004910| 65 72 2c 20 3d 3d 20 30 | 20 66 6f 72 20 63 6c 6f |er, == 0| for clo|
|00004920| 6e 65 73 20 2a 2f 0a 58 | 20 20 20 20 69 6e 74 09 |nes */.X| int.|
|00004930| 09 6e 63 68 69 6c 64 3b | 09 09 2f 2a 20 6e 6f 2e |.nchild;|../* no.|
|00004940| 20 6f 66 20 63 68 69 6c | 64 72 65 6e 20 66 6f 72 | of chil|dren for|
|00004950| 20 61 20 63 6c 6f 6e 65 | 20 74 6f 20 72 75 6e 20 | a clone| to run |
|00004960| 2a 2f 0a 58 20 20 20 20 | 69 6e 74 09 09 64 6f 6e |*/.X |int..don|
|00004970| 65 3b 09 09 2f 2a 20 63 | 6f 75 6e 74 20 6f 66 20 |e;../* c|ount of |
|00004980| 63 68 69 6c 64 72 65 6e | 20 66 69 6e 69 73 68 65 |children| finishe|
|00004990| 64 20 2a 2f 0a 58 20 20 | 20 20 69 6e 74 09 09 6f |d */.X | int..o|
|000049a0| 75 74 70 75 74 3b 09 09 | 2f 2a 20 61 67 67 72 65 |utput;..|/* aggre|
|000049b0| 67 61 74 65 20 6f 75 74 | 70 75 74 20 63 68 61 72 |gate out|put char|
|000049c0| 20 63 6f 75 6e 74 20 66 | 6f 72 20 61 6c 6c 0a 58 | count f|or all.X|
|000049d0| 09 09 09 09 20 20 20 63 | 68 69 6c 64 72 65 6e 20 |.... c|hildren |
|000049e0| 2a 2f 0a 58 20 20 20 20 | 69 6e 74 09 09 63 3b 0a |*/.X |int..c;.|
|000049f0| 58 20 20 20 20 69 6e 74 | 09 09 74 68 69 73 77 6f |X int|..thiswo|
|00004a00| 72 6b 20 3d 20 30 3b 09 | 2f 2a 20 6e 65 78 74 20 |rk = 0;.|/* next |
|00004a10| 6a 6f 62 20 73 74 72 65 | 61 6d 20 74 6f 20 61 6c |job stre|am to al|
|00004a20| 6c 6f 63 61 74 65 20 2a | 2f 0a 58 20 20 20 20 69 |locate *|/.X i|
|00004a30| 6e 74 09 09 6e 63 68 3b | 09 09 2f 2a 20 23 20 63 |nt..nch;|../* # c|
|00004a40| 68 61 72 61 63 74 65 72 | 73 20 74 6f 20 77 72 69 |haracter|s to wri|
|00004a50| 74 65 20 2a 2f 0a 58 20 | 20 20 20 69 6e 74 09 09 |te */.X | int..|
|00004a60| 77 72 69 74 74 65 6e 3b | 09 2f 2a 20 23 20 63 68 |written;|./* # ch|
|00004a70| 61 72 61 63 74 65 72 73 | 20 61 63 74 75 6c 6c 79 |aracters| actully|
|00004a80| 20 77 72 69 74 74 65 6e | 20 2a 2f 0a 58 20 20 20 | written| */.X |
|00004a90| 20 63 68 61 72 09 6c 6f | 67 6e 61 6d 65 5b 31 35 | char.lo|gname[15|
|00004aa0| 5d 3b 09 2f 2a 20 6e 61 | 6d 65 20 6f 66 20 74 68 |];./* na|me of th|
|00004ab0| 65 20 6c 6f 67 20 66 69 | 6c 65 28 73 29 20 2a 2f |e log fi|le(s) */|
|00004ac0| 0a 58 20 20 20 20 69 6e | 74 09 09 6f 6e 61 6c 61 |.X in|t..onala|
|00004ad0| 72 6d 28 29 3b 0a 58 20 | 20 20 20 69 6e 74 09 09 |rm();.X | int..|
|00004ae0| 70 69 70 65 65 72 72 28 | 29 3b 0a 58 20 20 20 20 |pipeerr(|);.X |
|00004af0| 69 6e 74 09 09 77 72 61 | 70 75 70 28 29 3b 0a 58 |int..wra|pup();.X|
|00004b00| 20 20 20 20 69 6e 74 09 | 09 67 72 75 6e 74 28 29 | int.|.grunt()|
|00004b10| 3b 0a 58 20 20 20 20 69 | 6e 74 09 09 70 76 65 63 |;.X i|nt..pvec|
|00004b20| 5b 32 5d 3b 09 2f 2a 20 | 66 6f 72 20 70 69 70 65 |[2];./* |for pipe|
|00004b30| 73 20 2a 2f 0a 58 20 20 | 20 20 63 68 61 72 09 2a |s */.X | char.*|
|00004b40| 70 3b 0a 58 20 20 20 20 | 63 68 61 72 09 2a 70 72 |p;.X |char.*pr|
|00004b50| 6f 67 3b 09 09 2f 2a 20 | 6d 79 20 6e 61 6d 65 20 |og;../* |my name |
|00004b60| 2a 2f 0a 58 0a 58 23 69 | 66 20 21 20 64 65 62 75 |*/.X.X#i|f ! debu|
|00004b70| 67 0a 58 20 20 20 20 66 | 72 65 6f 70 65 6e 28 22 |g.X f|reopen("|
|00004b80| 6d 61 73 74 65 72 6c 6f | 67 2e 30 30 22 2c 20 22 |masterlo|g.00", "|
|00004b90| 61 22 2c 20 73 74 64 65 | 72 72 29 3b 0a 58 23 65 |a", stde|rr);.X#e|
|00004ba0| 6e 64 69 66 0a 58 20 20 | 20 20 66 70 72 69 6e 74 |ndif.X | fprint|
|00004bb0| 66 28 73 74 64 65 72 72 | 2c 20 22 2a 2a 2a 20 4e |f(stderr|, "*** N|
|00004bc0| 65 77 20 52 75 6e 20 2a | 2a 2a 20 20 22 29 3b 0a |ew Run *|** ");.|
|00004bd0| 58 20 20 20 20 70 72 6f | 67 20 3d 20 61 72 67 76 |X pro|g = argv|
|00004be0| 5b 30 5d 3b 0a 58 20 20 | 20 20 77 68 69 6c 65 20 |[0];.X | while |
|00004bf0| 28 61 72 67 63 20 3e 20 | 31 20 26 26 20 61 72 67 |(argc > |1 && arg|
|00004c00| 76 5b 31 5d 5b 30 5d 20 | 3d 3d 20 27 2d 27 29 20 |v[1][0] |== '-') |
|00004c10| 20 7b 0a 58 09 70 20 3d | 20 26 61 72 67 76 5b 31 | {.X.p =| &argv[1|
|00004c20| 5d 5b 31 5d 3b 0a 58 09 | 61 72 67 63 2d 2d 3b 0a |][1];.X.|argc--;.|
|00004c30| 58 09 61 72 67 76 2b 2b | 3b 0a 58 09 77 68 69 6c |X.argv++|;.X.whil|
|00004c40| 65 20 28 2a 70 29 20 7b | 0a 58 09 20 20 20 20 73 |e (*p) {|.X. s|
|00004c50| 77 69 74 63 68 20 28 2a | 70 29 20 7b 0a 58 09 20 |witch (*|p) {.X. |
|00004c60| 20 20 20 63 61 73 65 20 | 27 72 27 3a 0a 58 09 09 | case |'r':.X..|
|00004c70| 09 65 73 74 5f 72 61 74 | 65 20 3d 20 61 74 6f 69 |.est_rat|e = atoi|
|00004c80| 28 61 72 67 76 5b 31 5d | 29 3b 0a 58 09 09 09 73 |(argv[1]|);.X...s|
|00004c90| 73 63 61 6e 66 28 61 72 | 67 76 5b 31 5d 2c 20 22 |scanf(ar|gv[1], "|
|00004ca0| 25 66 22 2c 20 26 65 73 | 74 5f 72 61 74 65 29 3b |%f", &es|t_rate);|
|00004cb0| 0a 58 09 09 09 69 66 20 | 28 65 73 74 5f 72 61 74 |.X...if |(est_rat|
|00004cc0| 65 20 3c 3d 20 30 29 20 | 7b 0a 58 09 09 09 20 20 |e <= 0) |{.X... |
|00004cd0| 20 20 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 | fprint|f(stderr|
|00004ce0| 2c 20 22 25 73 3a 20 62 | 61 64 20 72 61 74 65 2c |, "%s: b|ad rate,|
|00004cf0| 20 72 65 73 65 74 20 74 | 6f 20 25 2e 32 66 20 63 | reset t|o %.2f c|
|00004d00| 68 61 72 73 2f 73 65 63 | 5c 6e 22 2c 20 70 72 6f |hars/sec|\n", pro|
|00004d10| 67 2c 20 44 45 46 5f 52 | 41 54 45 29 3b 0a 58 09 |g, DEF_R|ATE);.X.|
|00004d20| 09 09 20 20 20 20 65 73 | 74 5f 72 61 74 65 20 3d |.. es|t_rate =|
|00004d30| 20 44 45 46 5f 52 41 54 | 45 3b 0a 58 09 09 09 7d | DEF_RAT|E;.X...}|
|00004d40| 0a 58 09 09 09 61 72 67 | 63 2d 2d 3b 0a 58 09 09 |.X...arg|c--;.X..|
|00004d50| 09 61 72 67 76 2b 2b 3b | 0a 58 09 09 09 62 72 65 |.argv++;|.X...bre|
|00004d60| 61 6b 3b 0a 58 0a 58 09 | 20 20 20 20 63 61 73 65 |ak;.X.X.| case|
|00004d70| 20 27 63 27 3a 0a 58 09 | 09 09 66 63 6f 70 79 20 | 'c':.X.|..fcopy |
|00004d80| 3d 20 6f 70 65 6e 28 61 | 72 67 76 5b 31 5d 2c 20 |= open(a|rgv[1], |
|00004d90| 31 29 3b 0a 58 09 09 09 | 69 66 20 28 66 63 6f 70 |1);.X...|if (fcop|
|00004da0| 79 20 3c 20 30 29 0a 58 | 09 09 09 09 66 63 6f 70 |y < 0).X|....fcop|
|00004db0| 79 20 3d 20 63 72 65 61 | 74 28 61 72 67 76 5b 31 |y = crea|t(argv[1|
|00004dc0| 5d 2c 20 30 36 30 30 29 | 3b 0a 58 09 09 09 69 66 |], 0600)|;.X...if|
|00004dd0| 20 28 66 63 6f 70 79 20 | 3c 20 30 29 20 7b 0a 58 | (fcopy |< 0) {.X|
|00004de0| 09 09 09 20 20 20 20 66 | 70 72 69 6e 74 66 28 73 |... f|printf(s|
|00004df0| 74 64 65 72 72 2c 20 22 | 25 73 3a 20 63 61 6e 6e |tderr, "|%s: cann|
|00004e00| 6f 74 20 6f 70 65 6e 20 | 63 6f 70 79 20 66 69 6c |ot open |copy fil|
|00004e10| 65 20 27 25 73 27 5c 6e | 22 2c 0a 58 09 09 09 09 |e '%s'\n|",.X....|
|00004e20| 70 72 6f 67 2c 20 61 72 | 67 76 5b 31 5d 29 3b 0a |prog, ar|gv[1]);.|
|00004e30| 58 09 09 09 20 20 20 20 | 65 78 69 74 28 32 29 3b |X... |exit(2);|
|00004e40| 0a 58 09 09 09 7d 0a 58 | 09 09 09 6c 73 65 65 6b |.X...}.X|...lseek|
|00004e50| 28 66 63 6f 70 79 2c 20 | 30 4c 2c 20 32 29 3b 09 |(fcopy, |0L, 2);.|
|00004e60| 2f 2a 20 61 70 70 65 6e | 64 20 61 74 20 65 6e 64 |/* appen|d at end|
|00004e70| 20 6f 66 20 66 69 6c 65 | 20 2a 2f 0a 58 09 09 09 | of file| */.X...|
|00004e80| 61 72 67 63 2d 2d 3b 0a | 58 09 09 09 61 72 67 76 |argc--;.|X...argv|
|00004e90| 2b 2b 3b 0a 58 09 09 09 | 62 72 65 61 6b 3b 0a 58 |++;.X...|break;.X|
|00004ea0| 0a 58 09 20 20 20 20 64 | 65 66 61 75 6c 74 3a 0a |.X. d|efault:.|
|00004eb0| 58 09 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |X..fprin|tf(stder|
|00004ec0| 72 2c 20 22 25 73 3a 20 | 62 61 64 20 66 6c 61 67 |r, "%s: |bad flag|
|00004ed0| 20 27 25 63 27 5c 6e 22 | 2c 20 70 72 6f 67 2c 20 | '%c'\n"|, prog, |
|00004ee0| 2a 70 29 3b 0a 58 09 09 | 09 65 78 69 74 28 34 29 |*p);.X..|.exit(4)|
|00004ef0| 3b 0a 58 09 20 20 20 20 | 7d 0a 58 09 20 20 20 20 |;.X. |}.X. |
|00004f00| 70 2b 2b 3b 0a 58 09 7d | 0a 58 20 20 20 20 7d 0a |p++;.X.}|.X }.|
|00004f10| 58 20 20 20 20 0a 58 20 | 20 20 20 69 66 20 28 61 |X .X | if (a|
|00004f20| 72 67 63 20 3c 20 32 29 | 20 7b 0a 58 09 66 70 72 |rgc < 2)| {.X.fpr|
|00004f30| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 25 73 |intf(std|err, "%s|
|00004f40| 3a 20 6d 69 73 73 69 6e | 67 20 6e 75 73 65 72 73 |: missin|g nusers|
|00004f50| 5c 6e 22 2c 20 70 72 6f | 67 29 3b 0a 58 09 65 78 |\n", pro|g);.X.ex|
|00004f60| 69 74 28 34 29 3b 0a 58 | 20 20 20 20 7d 0a 58 0a |it(4);.X| }.X.|
|00004f70| 58 20 20 20 20 6e 75 73 | 65 72 73 20 3d 20 61 74 |X nus|ers = at|
|00004f80| 6f 69 28 61 72 67 76 5b | 31 5d 29 3b 0a 58 20 20 |oi(argv[|1]);.X |
|00004f90| 20 20 69 66 20 28 6e 75 | 73 65 72 73 20 3c 20 31 | if (nu|sers < 1|
|00004fa0| 29 20 7b 0a 58 09 66 70 | 72 69 6e 74 66 28 73 74 |) {.X.fp|rintf(st|
|00004fb0| 64 65 72 72 2c 20 22 25 | 73 3a 20 69 6d 70 6f 73 |derr, "%|s: impos|
|00004fc0| 73 69 62 6c 65 20 6e 75 | 73 65 72 73 20 28 25 64 |sible nu|sers (%d|
|00004fd0| 3c 2d 25 73 29 5c 6e 22 | 2c 20 70 72 6f 67 2c 20 |<-%s)\n"|, prog, |
|00004fe0| 6e 75 73 65 72 73 2c 20 | 61 72 67 76 5b 31 5d 29 |nusers, |argv[1])|
|00004ff0| 3b 0a 58 09 65 78 69 74 | 28 34 29 3b 0a 58 20 20 |;.X.exit|(4);.X |
|00005000| 20 20 7d 0a 58 20 20 20 | 20 66 70 72 69 6e 74 66 | }.X | fprintf|
|00005010| 28 73 74 64 65 72 72 2c | 20 22 25 64 20 55 73 65 |(stderr,| "%d Use|
|00005020| 72 73 5c 6e 22 2c 20 6e | 75 73 65 72 73 29 3b 0a |rs\n", n|users);.|
|00005030| 58 20 20 20 20 61 72 67 | 63 2d 2d 3b 0a 58 20 20 |X arg|c--;.X |
|00005040| 20 20 61 72 67 76 2b 2b | 3b 0a 58 0a 58 20 20 20 | argv++|;.X.X |
|00005050| 20 2f 2a 20 62 75 69 6c | 64 20 6a 6f 62 20 73 74 | /* buil|d job st|
|00005060| 72 65 61 6d 73 20 2a 2f | 0a 58 20 20 20 20 67 65 |reams */|.X ge|
|00005070| 74 77 6f 72 6b 28 29 3b | 0a 58 23 69 66 20 64 65 |twork();|.X#if de|
|00005080| 62 75 67 0a 58 20 20 20 | 20 64 75 6d 70 77 6f 72 |bug.X | dumpwor|
|00005090| 6b 28 29 3b 0a 58 23 65 | 6e 64 69 66 0a 58 0a 58 |k();.X#e|ndif.X.X|
|000050a0| 20 20 20 20 2f 2a 20 63 | 6c 6f 6e 65 20 63 6f 70 | /* c|lone cop|
|000050b0| 69 65 73 20 6f 66 20 6d | 79 73 65 6c 66 20 74 6f |ies of m|yself to|
|000050c0| 20 72 75 6e 20 75 70 20 | 74 6f 20 4d 41 58 43 48 | run up |to MAXCH|
|000050d0| 49 4c 44 20 6a 6f 62 73 | 20 65 61 63 68 20 2a 2f |ILD jobs| each */|
|000050e0| 0a 58 20 20 20 20 66 69 | 72 73 74 75 73 65 72 20 |.X fi|rstuser |
|000050f0| 3d 20 4d 41 58 43 48 49 | 4c 44 3b 0a 58 20 20 20 |= MAXCHI|LD;.X |
|00005100| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|00005110| 20 22 6d 61 73 74 65 72 | 20 70 69 64 20 25 64 5c | "master| pid %d\|
|00005120| 6e 22 2c 20 67 65 74 70 | 69 64 28 29 29 3b 0a 58 |n", getp|id());.X|
|00005130| 20 20 20 20 66 66 6c 75 | 73 68 28 73 74 64 65 72 | fflu|sh(stder|
|00005140| 72 29 3b 0a 58 20 20 20 | 20 77 68 69 6c 65 20 28 |r);.X | while (|
|00005150| 6e 75 73 65 72 73 20 3e | 20 4d 41 58 43 48 49 4c |nusers >| MAXCHIL|
|00005160| 44 29 20 7b 0a 58 09 66 | 66 6c 75 73 68 28 73 74 |D) {.X.f|flush(st|
|00005170| 64 65 72 72 29 3b 0a 58 | 09 69 66 20 28 6e 75 73 |derr);.X|.if (nus|
|00005180| 65 72 73 20 3e 3d 20 32 | 2a 4d 41 58 43 48 49 4c |ers >= 2|*MAXCHIL|
|00005190| 44 29 0a 58 09 20 20 20 | 20 2f 2a 20 74 68 65 20 |D).X. | /* the |
|000051a0| 6e 65 78 74 20 63 6c 6f | 6e 65 20 6d 75 73 74 20 |next clo|ne must |
|000051b0| 72 75 6e 20 4d 41 58 43 | 48 49 4c 44 20 6a 6f 62 |run MAXC|HILD job|
|000051c0| 73 20 2a 2f 0a 58 09 20 | 20 20 20 6e 63 68 69 6c |s */.X. | nchil|
|000051d0| 64 20 3d 20 4d 41 58 43 | 48 49 4c 44 3b 0a 58 09 |d = MAXC|HILD;.X.|
|000051e0| 65 6c 73 65 0a 58 09 20 | 20 20 20 2f 2a 20 74 68 |else.X. | /* th|
|000051f0| 65 20 6e 65 78 74 20 63 | 6c 6f 6e 65 20 6d 75 73 |e next c|lone mus|
|00005200| 74 20 72 75 6e 20 74 68 | 65 20 6c 65 66 74 6f 76 |t run th|e leftov|
|00005210| 65 72 20 6a 6f 62 73 20 | 2a 2f 0a 58 09 20 20 20 |er jobs |*/.X. |
|00005220| 20 6e 63 68 69 6c 64 20 | 3d 20 6e 75 73 65 72 73 | nchild |= nusers|
|00005230| 20 2d 20 4d 41 58 43 48 | 49 4c 44 3b 0a 58 09 69 | - MAXCH|ILD;.X.i|
|00005240| 66 20 28 28 6c 20 3d 20 | 66 6f 72 6b 28 29 29 20 |f ((l = |fork()) |
|00005250| 3d 3d 20 2d 31 29 20 7b | 0a 58 09 20 20 20 20 2f |== -1) {|.X. /|
|00005260| 2a 20 66 6f 72 6b 20 66 | 61 69 6c 65 64 20 2a 2f |* fork f|ailed */|
|00005270| 0a 58 09 20 20 20 20 66 | 61 74 61 6c 28 22 2a 2a |.X. f|atal("**|
|00005280| 20 63 6c 6f 6e 65 20 66 | 6f 72 6b 20 66 61 69 6c | clone f|ork fail|
|00005290| 65 64 20 2a 2a 5c 6e 22 | 29 3b 0a 58 09 20 20 20 |ed **\n"|);.X. |
|000052a0| 20 67 6f 74 6f 20 62 65 | 70 61 74 69 65 6e 74 3b | goto be|patient;|
|000052b0| 0a 58 09 7d 20 65 6c 73 | 65 20 69 66 20 28 6c 20 |.X.} els|e if (l |
|000052c0| 3e 20 30 29 20 7b 0a 58 | 09 20 20 20 20 66 70 72 |> 0) {.X|. fpr|
|000052d0| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 6d 61 |intf(std|err, "ma|
|000052e0| 73 74 65 72 20 63 6c 6f | 6e 65 20 70 69 64 20 25 |ster clo|ne pid %|
|000052f0| 64 5c 6e 22 2c 20 6c 29 | 3b 0a 58 09 20 20 20 20 |d\n", l)|;.X. |
|00005300| 2f 2a 20 49 20 61 6d 20 | 74 68 65 20 6d 61 73 74 |/* I am |the mast|
|00005310| 65 72 20 77 69 74 68 20 | 6e 63 68 69 6c 64 20 66 |er with |nchild f|
|00005320| 65 77 65 72 20 6a 6f 62 | 73 20 74 6f 20 72 75 6e |ewer job|s to run|
|00005330| 20 2a 2f 0a 58 09 20 20 | 20 20 6e 75 73 65 72 73 | */.X. | nusers|
|00005340| 20 2d 3d 20 6e 63 68 69 | 6c 64 3b 0a 58 09 20 20 | -= nchi|ld;.X. |
|00005350| 20 20 66 69 72 73 74 75 | 73 65 72 20 2b 3d 20 4d | firstu|ser += M|
|00005360| 41 58 43 48 49 4c 44 3b | 0a 58 09 20 20 20 20 63 |AXCHILD;|.X. c|
|00005370| 6f 6e 74 69 6e 75 65 3b | 0a 58 09 7d 20 65 6c 73 |ontinue;|.X.} els|
|00005380| 65 20 7b 0a 58 09 20 20 | 20 20 2f 2a 20 49 20 61 |e {.X. | /* I a|
|00005390| 6d 20 61 20 63 6c 6f 6e | 65 2c 20 72 75 6e 20 4d |m a clon|e, run M|
|000053a0| 41 58 43 48 49 4c 44 20 | 6a 6f 62 73 20 2a 2f 0a |AXCHILD |jobs */.|
|000053b0| 58 23 69 66 20 21 20 64 | 65 62 75 67 0a 58 09 20 |X#if ! d|ebug.X. |
|000053c0| 20 20 20 73 70 72 69 6e | 74 66 28 6c 6f 67 6e 61 | sprin|tf(logna|
|000053d0| 6d 65 2c 20 22 6d 61 73 | 74 65 72 6c 6f 67 2e 25 |me, "mas|terlog.%|
|000053e0| 30 32 64 22 2c 20 66 69 | 72 73 74 75 73 65 72 2f |02d", fi|rstuser/|
|000053f0| 4d 41 58 43 48 49 4c 44 | 29 3b 0a 58 09 20 20 20 |MAXCHILD|);.X. |
|00005400| 20 66 72 65 6f 70 65 6e | 28 6c 6f 67 6e 61 6d 65 | freopen|(logname|
|00005410| 2c 20 22 77 22 2c 20 73 | 74 64 65 72 72 29 3b 0a |, "w", s|tderr);.|
|00005420| 58 23 65 6e 64 69 66 0a | 58 09 20 20 20 20 6d 61 |X#endif.|X. ma|
|00005430| 73 74 65 72 20 3d 20 30 | 3b 0a 58 09 20 20 20 20 |ster = 0|;.X. |
|00005440| 6e 75 73 65 72 73 20 3d | 20 6e 63 68 69 6c 64 3b |nusers =| nchild;|
|00005450| 0a 58 09 20 20 20 20 62 | 72 65 61 6b 3b 0a 58 09 |.X. b|reak;.X.|
|00005460| 7d 0a 58 20 20 20 20 7d | 0a 58 20 20 20 20 69 66 |}.X }|.X if|
|00005470| 20 28 6d 61 73 74 65 72 | 29 0a 58 09 66 69 72 73 | (master|).X.firs|
|00005480| 74 75 73 65 72 20 3d 20 | 30 3b 0a 58 0a 58 20 20 |tuser = |0;.X.X |
|00005490| 20 20 63 6c 6f 73 65 28 | 30 29 3b 0a 58 20 20 20 | close(|0);.X |
|000054a0| 20 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 69 20 3c | for (i |= 0; i <|
|000054b0| 20 6e 75 73 65 72 73 3b | 20 69 2b 2b 20 29 20 7b | nusers;| i++ ) {|
|000054c0| 0a 58 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |.X.fprin|tf(stder|
|000054d0| 72 2c 20 22 75 73 65 72 | 20 25 64 20 6a 6f 62 20 |r, "user| %d job |
|000054e0| 25 64 20 22 2c 20 66 69 | 72 73 74 75 73 65 72 2b |%d ", fi|rstuser+|
|000054f0| 69 2c 20 74 68 69 73 77 | 6f 72 6b 29 3b 0a 58 09 |i, thisw|ork);.X.|
|00005500| 69 66 20 28 70 69 70 65 | 28 70 76 65 63 29 20 3d |if (pipe|(pvec) =|
|00005510| 3d 20 2d 31 29 20 7b 0a | 58 09 20 20 20 20 2f 2a |= -1) {.|X. /*|
|00005520| 20 74 68 69 73 20 69 73 | 20 66 61 74 61 6c 20 2a | this is| fatal *|
|00005530| 2f 0a 58 09 20 20 20 20 | 66 61 74 61 6c 28 22 2a |/.X. |fatal("*|
|00005540| 2a 20 70 69 70 65 20 66 | 61 69 6c 65 64 20 2a 2a |* pipe f|ailed **|
|00005550| 5c 6e 22 29 3b 0a 58 09 | 20 20 20 20 67 6f 74 6f |\n");.X.| goto|
|00005560| 20 62 65 70 61 74 69 65 | 6e 74 3b 0a 58 09 7d 0a | bepatie|nt;.X.}.|
|00005570| 58 09 66 66 6c 75 73 68 | 28 73 74 64 65 72 72 29 |X.fflush|(stderr)|
|00005580| 3b 0a 58 09 69 66 20 28 | 28 63 68 69 6c 64 5b 69 |;.X.if (|(child[i|
|00005590| 5d 2e 70 69 64 20 3d 20 | 66 6f 72 6b 28 29 29 20 |].pid = |fork()) |
|000055a0| 3d 3d 20 30 29 20 7b 0a | 58 09 20 20 20 20 69 6e |== 0) {.|X. in|
|000055b0| 74 09 66 64 3b 0a 58 09 | 20 20 20 20 2f 2a 20 74 |t.fd;.X.| /* t|
|000055c0| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 2a 2f 0a 58 09 |he comma|nd */.X.|
|000055d0| 20 20 20 20 69 66 20 28 | 70 76 65 63 5b 30 5d 20 | if (|pvec[0] |
|000055e0| 21 3d 20 30 29 20 7b 0a | 58 09 09 63 6c 6f 73 65 |!= 0) {.|X..close|
|000055f0| 28 30 29 3b 0a 58 09 09 | 64 75 70 28 70 76 65 63 |(0);.X..|dup(pvec|
|00005600| 5b 30 5d 29 3b 0a 58 09 | 20 20 20 20 7d 0a 58 23 |[0]);.X.| }.X#|
|00005610| 69 66 20 21 20 64 65 62 | 75 67 0a 58 09 20 20 20 |if ! deb|ug.X. |
|00005620| 20 73 70 72 69 6e 74 66 | 28 6c 6f 67 6e 61 6d 65 | sprintf|(logname|
|00005630| 2c 20 22 75 73 65 72 6c | 6f 67 2e 25 30 32 64 22 |, "userl|og.%02d"|
|00005640| 2c 20 66 69 72 73 74 75 | 73 65 72 2b 69 29 3b 0a |, firstu|ser+i);.|
|00005650| 58 09 20 20 20 20 66 72 | 65 6f 70 65 6e 28 6c 6f |X. fr|eopen(lo|
|00005660| 67 6e 61 6d 65 2c 20 22 | 77 22 2c 20 73 74 64 65 |gname, "|w", stde|
|00005670| 72 72 29 3b 0a 58 23 65 | 6e 64 69 66 0a 58 09 20 |rr);.X#e|ndif.X. |
|00005680| 20 20 20 66 6f 72 20 28 | 66 64 20 3d 20 33 3b 20 | for (|fd = 3; |
|00005690| 66 64 20 3c 20 32 34 3b | 20 66 64 2b 2b 29 0a 58 |fd < 24;| fd++).X|
|000056a0| 09 09 63 6c 6f 73 65 28 | 66 64 29 3b 0a 58 09 20 |..close(|fd);.X. |
|000056b0| 20 20 20 69 66 20 28 77 | 6f 72 6b 5b 74 68 69 73 | if (w|ork[this|
|000056c0| 77 6f 72 6b 5d 2e 6f 75 | 74 66 5b 30 5d 20 21 3d |work].ou|tf[0] !=|
|000056d0| 20 27 5c 30 27 29 20 7b | 0a 58 09 09 2f 2a 20 72 | '\0') {|.X../* r|
|000056e0| 65 64 69 72 65 63 74 20 | 73 74 64 20 6f 75 74 70 |edirect |std outp|
|000056f0| 75 74 20 2a 2f 0a 58 09 | 09 63 68 61 72 09 2a 71 |ut */.X.|.char.*q|
|00005700| 3b 0a 58 09 09 66 6f 72 | 20 28 71 20 3d 20 77 6f |;.X..for| (q = wo|
|00005710| 72 6b 5b 74 68 69 73 77 | 6f 72 6b 5d 2e 6f 75 74 |rk[thisw|ork].out|
|00005720| 66 3b 20 2a 71 20 21 3d | 20 27 5c 6e 27 3b 20 71 |f; *q !=| '\n'; q|
|00005730| 2b 2b 29 20 3b 0a 58 09 | 09 2a 71 20 3d 20 27 5c |++) ;.X.|.*q = '\|
|00005740| 30 27 3b 0a 58 09 09 69 | 66 20 28 66 72 65 6f 70 |0';.X..i|f (freop|
|00005750| 65 6e 28 77 6f 72 6b 5b | 74 68 69 73 77 6f 72 6b |en(work[|thiswork|
|00005760| 5d 2e 6f 75 74 66 2c 20 | 22 77 22 2c 20 73 74 64 |].outf, |"w", std|
|00005770| 6f 75 74 29 20 3d 3d 20 | 4e 55 4c 4c 29 20 7b 0a |out) == |NULL) {.|
|00005780| 58 09 09 20 20 20 20 66 | 70 72 69 6e 74 66 28 73 |X.. f|printf(s|
|00005790| 74 64 65 72 72 2c 20 22 | 6d 61 6b 65 77 6f 72 6b |tderr, "|makework|
|000057a0| 3a 20 63 61 6e 6e 6f 74 | 20 6f 70 65 6e 20 25 73 |: cannot| open %s|
|000057b0| 20 66 6f 72 20 73 74 64 | 20 6f 75 74 70 75 74 5c | for std| output\|
|000057c0| 6e 22 2c 0a 58 09 09 09 | 77 6f 72 6b 5b 74 68 69 |n",.X...|work[thi|
|000057d0| 73 77 6f 72 6b 5d 2e 6f | 75 74 66 29 3b 0a 58 09 |swork].o|utf);.X.|
|000057e0| 09 20 20 20 20 66 66 6c | 75 73 68 28 73 74 64 65 |. ffl|ush(stde|
|000057f0| 72 72 29 3b 0a 58 09 09 | 7d 0a 58 09 09 2a 71 20 |rr);.X..|}.X..*q |
|00005800| 3d 20 27 5c 6e 27 3b 0a | 58 09 20 20 20 20 7d 0a |= '\n';.|X. }.|
|00005810| 58 09 20 20 20 20 65 78 | 65 63 76 28 77 6f 72 6b |X. ex|ecv(work|
|00005820| 5b 74 68 69 73 77 6f 72 | 6b 5d 2e 63 6d 64 2c 20 |[thiswor|k].cmd, |
|00005830| 77 6f 72 6b 5b 74 68 69 | 73 77 6f 72 6b 5d 2e 61 |work[thi|swork].a|
|00005840| 76 29 3b 0a 58 09 20 20 | 20 20 2f 2a 20 64 6f 6e |v);.X. | /* don|
|00005850| 27 74 20 65 78 70 65 63 | 74 20 74 6f 20 67 65 74 |'t expec|t to get|
|00005860| 20 68 65 72 65 21 20 2a | 2f 0a 58 09 20 20 20 20 | here! *|/.X. |
|00005870| 66 61 74 61 6c 28 22 2a | 2a 20 65 78 65 63 20 66 |fatal("*|* exec f|
|00005880| 61 69 6c 65 64 20 2a 2a | 5c 6e 22 29 3b 0a 58 09 |ailed **|\n");.X.|
|00005890| 20 20 20 20 67 6f 74 6f | 20 62 65 70 61 74 69 65 | goto| bepatie|
|000058a0| 6e 74 3b 0a 58 09 7d 0a | 58 09 65 6c 73 65 20 69 |nt;.X.}.|X.else i|
|000058b0| 66 20 28 63 68 69 6c 64 | 5b 69 5d 2e 70 69 64 20 |f (child|[i].pid |
|000058c0| 3d 3d 20 2d 31 29 20 7b | 0a 58 09 20 20 20 20 66 |== -1) {|.X. f|
|000058d0| 61 74 61 6c 28 22 2a 2a | 20 66 6f 72 6b 20 66 61 |atal("**| fork fa|
|000058e0| 69 6c 65 64 20 2a 2a 5c | 6e 22 29 3b 0a 58 09 20 |iled **\|n");.X. |
|000058f0| 20 20 20 67 6f 74 6f 20 | 62 65 70 61 74 69 65 6e | goto |bepatien|
|00005900| 74 3b 0a 58 09 7d 0a 58 | 09 65 6c 73 65 20 7b 0a |t;.X.}.X|.else {.|
|00005910| 58 09 20 20 20 20 63 6c | 6f 73 65 28 70 76 65 63 |X. cl|ose(pvec|
|00005920| 5b 30 5d 29 3b 0a 58 09 | 20 20 20 20 63 68 69 6c |[0]);.X.| chil|
|00005930| 64 5b 69 5d 2e 66 64 20 | 3d 20 70 76 65 63 5b 31 |d[i].fd |= pvec[1|
|00005940| 5d 3b 0a 58 09 20 20 20 | 20 63 68 69 6c 64 5b 69 |];.X. | child[i|
|00005950| 5d 2e 6c 69 6e 65 20 3d | 20 63 68 69 6c 64 5b 69 |].line =| child[i|
|00005960| 5d 2e 62 70 20 3d 20 77 | 6f 72 6b 5b 74 68 69 73 |].bp = w|ork[this|
|00005970| 77 6f 72 6b 5d 2e 69 6e | 70 75 74 3b 0a 58 09 20 |work].in|put;.X. |
|00005980| 20 20 20 63 68 69 6c 64 | 5b 69 5d 2e 62 6c 65 6e | child|[i].blen|
|00005990| 20 3d 20 77 6f 72 6b 5b | 74 68 69 73 77 6f 72 6b | = work[|thiswork|
|000059a0| 5d 2e 69 6e 70 73 69 7a | 65 3b 0a 58 09 20 20 20 |].inpsiz|e;.X. |
|000059b0| 20 63 68 69 6c 64 5b 69 | 5d 2e 74 68 69 73 6a 6f | child[i|].thisjo|
|000059c0| 62 20 3d 20 74 68 69 73 | 77 6f 72 6b 3b 0a 58 09 |b = this|work;.X.|
|000059d0| 20 20 20 20 63 68 69 6c | 64 5b 69 5d 2e 66 69 72 | chil|d[i].fir|
|000059e0| 73 74 6a 6f 62 20 3d 20 | 74 68 69 73 77 6f 72 6b |stjob = |thiswork|
|000059f0| 3b 0a 58 09 20 20 20 20 | 66 70 72 69 6e 74 66 28 |;.X. |fprintf(|
|00005a00| 73 74 64 65 72 72 2c 20 | 22 70 69 64 20 25 64 20 |stderr, |"pid %d |
|00005a10| 70 69 70 65 20 66 64 20 | 25 64 22 2c 20 63 68 69 |pipe fd |%d", chi|
|00005a20| 6c 64 5b 69 5d 2e 70 69 | 64 2c 20 63 68 69 6c 64 |ld[i].pi|d, child|
|00005a30| 5b 69 5d 2e 66 64 29 3b | 0a 58 09 20 20 20 20 69 |[i].fd);|.X. i|
|00005a40| 66 20 28 77 6f 72 6b 5b | 74 68 69 73 77 6f 72 6b |f (work[|thiswork|
|00005a50| 5d 2e 6f 75 74 66 5b 30 | 5d 20 21 3d 20 27 5c 30 |].outf[0|] != '\0|
|00005a60| 27 29 20 7b 0a 58 09 09 | 63 68 61 72 20 2a 71 3b |') {.X..|char *q;|
|00005a70| 0a 58 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 |.X..fpri|ntf(stde|
|00005a80| 72 72 2c 20 22 20 3e 20 | 22 29 3b 0a 58 09 09 66 |rr, " > |");.X..f|
|00005a90| 6f 72 20 28 71 3d 77 6f | 72 6b 5b 74 68 69 73 77 |or (q=wo|rk[thisw|
|00005aa0| 6f 72 6b 5d 2e 6f 75 74 | 66 3b 20 2a 71 20 21 3d |ork].out|f; *q !=|
|00005ab0| 20 27 5c 6e 27 3b 20 71 | 2b 2b 29 0a 58 09 09 20 | '\n'; q|++).X.. |
|00005ac0| 20 20 20 66 70 75 74 63 | 28 2a 71 2c 20 73 74 64 | fputc|(*q, std|
|00005ad0| 65 72 72 29 3b 0a 58 09 | 20 20 20 20 7d 0a 58 09 |err);.X.| }.X.|
|00005ae0| 20 20 20 20 66 70 75 74 | 63 28 27 5c 6e 27 2c 20 | fput|c('\n', |
|00005af0| 73 74 64 65 72 72 29 3b | 0a 58 09 20 20 20 20 74 |stderr);|.X. t|
|00005b00| 68 69 73 77 6f 72 6b 2b | 2b 3b 0a 58 09 20 20 20 |hiswork+|+;.X. |
|00005b10| 20 69 66 20 28 74 68 69 | 73 77 6f 72 6b 20 3e 3d | if (thi|swork >=|
|00005b20| 20 6e 77 6f 72 6b 29 0a | 58 09 09 74 68 69 73 77 | nwork).|X..thisw|
|00005b30| 6f 72 6b 20 3d 20 30 3b | 0a 58 09 7d 0a 58 20 20 |ork = 0;|.X.}.X |
|00005b40| 20 20 7d 0a 58 20 20 20 | 20 66 66 6c 75 73 68 28 | }.X | fflush(|
|00005b50| 73 74 64 65 72 72 29 3b | 0a 58 0a 58 20 20 20 20 |stderr);|.X.X |
|00005b60| 73 72 61 6e 64 28 74 69 | 6d 65 28 30 29 29 3b 0a |srand(ti|me(0));.|
|00005b70| 58 20 20 20 20 74 68 72 | 65 73 20 3d 20 30 3b 0a |X thr|es = 0;.|
|00005b80| 58 20 20 20 20 64 6f 6e | 65 20 3d 20 6f 75 74 70 |X don|e = outp|
|00005b90| 75 74 20 3d 20 30 3b 0a | 58 20 20 20 20 66 6f 72 |ut = 0;.|X for|
|00005ba0| 20 28 69 20 3d 20 30 3b | 20 69 20 3c 20 6e 75 73 | (i = 0;| i < nus|
|00005bb0| 65 72 73 3b 20 69 2b 2b | 29 20 7b 0a 58 09 69 66 |ers; i++|) {.X.if|
|00005bc0| 20 28 63 68 69 6c 64 5b | 69 5d 2e 62 6c 65 6e 20 | (child[|i].blen |
|00005bd0| 3d 3d 20 30 29 0a 58 09 | 20 20 20 20 64 6f 6e 65 |== 0).X.| done|
|00005be0| 2b 2b 3b 0a 58 09 65 6c | 73 65 0a 58 09 20 20 20 |++;.X.el|se.X. |
|00005bf0| 20 74 68 72 65 73 20 2b | 3d 20 65 73 74 5f 72 61 | thres +|= est_ra|
|00005c00| 74 65 20 2a 20 47 52 41 | 4e 55 4c 45 3b 0a 58 20 |te * GRA|NULE;.X |
|00005c10| 20 20 20 7d 0a 58 20 20 | 20 20 65 73 74 5f 72 61 | }.X | est_ra|
|00005c20| 74 65 20 3d 20 74 68 72 | 65 73 3b 0a 58 0a 58 20 |te = thr|es;.X.X |
|00005c30| 20 20 20 73 69 67 6e 61 | 6c 28 53 49 47 41 4c 52 | signa|l(SIGALR|
|00005c40| 4d 2c 20 6f 6e 61 6c 61 | 72 6d 29 3b 0a 58 20 20 |M, onala|rm);.X |
|00005c50| 20 20 73 69 67 6e 61 6c | 28 53 49 47 50 49 50 45 | signal|(SIGPIPE|
|00005c60| 2c 20 70 69 70 65 65 72 | 72 29 3b 0a 58 20 20 20 |, pipeer|r);.X |
|00005c70| 20 61 6c 61 72 6d 28 47 | 52 41 4e 55 4c 45 29 3b | alarm(G|RANULE);|
|00005c80| 0a 58 20 20 20 20 77 68 | 69 6c 65 20 28 64 6f 6e |.X wh|ile (don|
|00005c90| 65 20 3c 20 6e 75 73 65 | 72 73 29 20 7b 0a 58 09 |e < nuse|rs) {.X.|
|00005ca0| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|00005cb0| 6e 75 73 65 72 73 3b 20 | 69 2b 2b 29 20 7b 0a 58 |nusers; |i++) {.X|
|00005cc0| 09 20 20 20 20 63 70 20 | 3d 20 26 63 68 69 6c 64 |. cp |= &child|
|00005cd0| 5b 69 5d 3b 0a 58 09 20 | 20 20 20 69 66 20 28 63 |[i];.X. | if (c|
|00005ce0| 70 2d 3e 78 6d 69 74 20 | 3e 3d 20 63 70 2d 3e 62 |p->xmit |>= cp->b|
|00005cf0| 6c 65 6e 29 20 63 6f 6e | 74 69 6e 75 65 3b 0a 58 |len) con|tinue;.X|
|00005d00| 09 20 20 20 20 6c 20 3d | 20 72 61 6e 64 28 29 20 |. l =| rand() |
|00005d10| 25 20 43 48 55 4e 4b 20 | 2b 20 31 3b 09 2f 2a 20 |% CHUNK |+ 1;./* |
|00005d20| 31 2d 43 48 55 4e 4b 20 | 63 68 61 72 73 20 2a 2f |1-CHUNK |chars */|
|00005d30| 0a 58 09 20 20 20 20 69 | 66 20 28 6c 20 3d 3d 20 |.X. i|f (l == |
|00005d40| 30 29 20 63 6f 6e 74 69 | 6e 75 65 3b 0a 58 09 20 |0) conti|nue;.X. |
|00005d50| 20 20 20 69 66 20 28 63 | 70 2d 3e 78 6d 69 74 20 | if (c|p->xmit |
|00005d60| 2b 20 6c 20 3e 20 63 70 | 2d 3e 62 6c 65 6e 29 0a |+ l > cp|->blen).|
|00005d70| 58 09 09 6c 20 3d 20 63 | 70 2d 3e 62 6c 65 6e 20 |X..l = c|p->blen |
|00005d80| 2d 20 63 70 2d 3e 78 6d | 69 74 3b 0a 58 09 20 20 |- cp->xm|it;.X. |
|00005d90| 20 20 70 20 3d 20 63 70 | 2d 3e 62 70 3b 0a 58 09 | p = cp|->bp;.X.|
|00005da0| 20 20 20 20 63 70 2d 3e | 62 70 20 2b 3d 20 6c 3b | cp->|bp += l;|
|00005db0| 0a 58 09 20 20 20 20 63 | 70 2d 3e 78 6d 69 74 20 |.X. c|p->xmit |
|00005dc0| 2b 3d 20 6c 3b 0a 58 23 | 69 66 20 64 65 62 75 67 |+= l;.X#|if debug|
|00005dd0| 0a 58 09 20 20 20 20 66 | 70 72 69 6e 74 66 28 73 |.X. f|printf(s|
|00005de0| 74 64 65 72 72 2c 20 22 | 63 68 69 6c 64 20 25 64 |tderr, "|child %d|
|00005df0| 2c 20 25 64 20 70 72 6f | 63 65 73 73 65 64 2c 20 |, %d pro|cessed, |
|00005e00| 25 64 20 74 6f 20 67 6f | 5c 6e 22 2c 20 69 2c 20 |%d to go|\n", i, |
|00005e10| 63 70 2d 3e 78 6d 69 74 | 2c 20 63 70 2d 3e 62 6c |cp->xmit|, cp->bl|
|00005e20| 65 6e 20 2d 20 63 70 2d | 3e 78 6d 69 74 29 3b 0a |en - cp-|>xmit);.|
|00005e30| 58 23 65 6e 64 69 66 0a | 58 09 20 20 20 20 77 68 |X#endif.|X. wh|
|00005e40| 69 6c 65 20 28 70 20 3c | 20 63 70 2d 3e 62 70 29 |ile (p <| cp->bp)|
|00005e50| 20 7b 0a 58 09 09 69 66 | 20 28 2a 70 20 3d 3d 20 | {.X..if| (*p == |
|00005e60| 27 5c 6e 27 20 7c 7c 20 | 28 70 20 3d 3d 20 26 63 |'\n' || |(p == &c|
|00005e70| 70 2d 3e 62 70 5b 2d 31 | 5d 20 26 26 20 63 70 2d |p->bp[-1|] && cp-|
|00005e80| 3e 78 6d 69 74 20 3e 3d | 20 63 70 2d 3e 62 6c 65 |>xmit >=| cp->ble|
|00005e90| 6e 29 29 20 7b 0a 58 09 | 09 20 20 20 20 2f 2a 20 |n)) {.X.|. /* |
|00005ea0| 77 72 69 74 65 20 69 74 | 20 6f 75 74 20 2a 2f 0a |write it| out */.|
|00005eb0| 58 09 09 20 20 20 20 6e | 63 68 20 3d 20 70 20 2d |X.. n|ch = p -|
|00005ec0| 20 63 70 2d 3e 6c 69 6e | 65 20 2b 20 31 3b 0a 58 | cp->lin|e + 1;.X|
|00005ed0| 09 09 20 20 20 20 69 66 | 20 28 28 77 72 69 74 74 |.. if| ((writt|
|00005ee0| 65 6e 20 3d 20 77 72 69 | 74 65 28 63 70 2d 3e 66 |en = wri|te(cp->f|
|00005ef0| 64 2c 20 63 70 2d 3e 6c | 69 6e 65 2c 20 6e 63 68 |d, cp->l|ine, nch|
|00005f00| 29 29 20 21 3d 20 6e 63 | 68 29 20 7b 0a 58 09 09 |)) != nc|h) {.X..|
|00005f10| 09 2f 2a 20 61 72 67 68 | 21 20 2a 2f 0a 58 09 09 |./* argh|! */.X..|
|00005f20| 09 63 70 2d 3e 6c 69 6e | 65 5b 6e 63 68 5d 20 3d |.cp->lin|e[nch] =|
|00005f30| 20 27 5c 30 27 3b 0a 58 | 09 09 09 66 70 72 69 6e | '\0';.X|...fprin|
|00005f40| 74 66 28 73 74 64 65 72 | 72 2c 20 22 75 73 65 72 |tf(stder|r, "user|
|00005f50| 20 25 64 20 6a 6f 62 20 | 25 64 20 63 6d 64 20 25 | %d job |%d cmd %|
|00005f60| 73 20 22 2c 0a 58 09 09 | 09 09 66 69 72 73 74 75 |s ",.X..|..firstu|
|00005f70| 73 65 72 2b 69 2c 20 63 | 70 2d 3e 74 68 69 73 6a |ser+i, c|p->thisj|
|00005f80| 6f 62 2c 20 63 70 2d 3e | 6c 69 6e 65 29 3b 0a 58 |ob, cp->|line);.X|
|00005f90| 20 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 | ...fpri|ntf(stde|
|00005fa0| 72 72 2c 20 22 77 72 69 | 74 65 28 2c 2c 25 64 29 |rr, "wri|te(,,%d)|
|00005fb0| 20 72 65 74 75 72 6e 73 | 20 25 64 5c 6e 22 2c 20 | returns| %d\n", |
|00005fc0| 6e 63 68 2c 20 77 72 69 | 74 74 65 6e 29 3b 0a 58 |nch, wri|tten);.X|
|00005fd0| 09 09 09 69 66 20 28 73 | 69 67 70 69 70 65 29 0a |...if (s|igpipe).|
|00005fe0| 58 09 09 09 20 20 20 20 | 66 61 74 61 6c 28 22 2a |X... |fatal("*|
|00005ff0| 2a 20 53 49 47 50 49 50 | 45 20 65 72 72 6f 72 20 |* SIGPIP|E error |
|00006000| 2a 2a 5c 6e 22 29 3b 0a | 58 09 09 09 65 6c 73 65 |**\n");.|X...else|
|00006010| 0a 58 09 09 09 20 20 20 | 20 66 61 74 61 6c 28 22 |.X... | fatal("|
|00006020| 2a 2a 20 77 72 69 74 65 | 20 65 72 72 6f 72 20 2a |** write| error *|
|00006030| 2a 5c 6e 22 29 3b 0a 58 | 09 09 09 67 6f 74 6f 20 |*\n");.X|...goto |
|00006040| 62 65 70 61 74 69 65 6e | 74 3b 0a 58 0a 58 09 09 |bepatien|t;.X.X..|
|00006050| 20 20 20 20 7d 0a 58 09 | 09 20 20 20 20 69 66 20 | }.X.|. if |
|00006060| 28 66 63 6f 70 79 29 0a | 58 09 09 09 77 72 69 74 |(fcopy).|X...writ|
|00006070| 65 28 66 63 6f 70 79 2c | 20 63 70 2d 3e 6c 69 6e |e(fcopy,| cp->lin|
|00006080| 65 2c 20 70 20 2d 20 63 | 70 2d 3e 6c 69 6e 65 20 |e, p - c|p->line |
|00006090| 2b 20 31 29 3b 0a 58 23 | 69 66 20 64 65 62 75 67 |+ 1);.X#|if debug|
|000060a0| 0a 58 09 09 20 20 20 20 | 66 70 72 69 6e 74 66 28 |.X.. |fprintf(|
|000060b0| 73 74 64 65 72 72 2c 20 | 22 63 68 69 6c 64 20 25 |stderr, |"child %|
|000060c0| 64 20 67 65 74 73 20 5c | 22 22 2c 20 69 29 3b 0a |d gets \|"", i);.|
|000060d0| 58 09 09 20 20 20 20 7b | 0a 58 09 09 09 63 68 61 |X.. {|.X...cha|
|000060e0| 72 20 2a 71 20 3d 20 63 | 70 2d 3e 6c 69 6e 65 3b |r *q = c|p->line;|
|000060f0| 0a 58 09 09 09 77 68 69 | 6c 65 20 28 71 20 3c 3d |.X...whi|le (q <=|
|00006100| 20 70 29 20 7b 0a 58 09 | 09 09 09 69 66 20 28 2a | p) {.X.|...if (*|
|00006110| 71 20 3e 3d 20 27 20 27 | 20 26 26 20 2a 71 20 3c |q >= ' '| && *q <|
|00006120| 3d 20 27 7e 27 29 0a 58 | 09 09 09 09 09 66 70 75 |= '~').X|.....fpu|
|00006130| 74 63 28 2a 71 2c 20 73 | 74 64 65 72 72 29 3b 0a |tc(*q, s|tderr);.|
|00006140| 58 09 09 09 09 65 6c 73 | 65 0a 58 09 09 09 09 09 |X....els|e.X.....|
|00006150| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|00006160| 22 5c 5c 25 30 33 6f 22 | 2c 20 2a 71 29 3b 0a 58 |"\\%03o"|, *q);.X|
|00006170| 09 09 09 09 71 2b 2b 3b | 0a 58 09 09 09 7d 0a 58 |....q++;|.X...}.X|
|00006180| 09 09 20 20 20 20 7d 0a | 58 09 09 20 20 20 20 66 |.. }.|X.. f|
|00006190| 70 75 74 63 28 27 22 27 | 2c 20 73 74 64 65 72 72 |putc('"'|, stderr|
|000061a0| 29 3b 0a 58 23 65 6e 64 | 69 66 0a 58 09 09 20 20 |);.X#end|if.X.. |
|000061b0| 20 20 63 70 2d 3e 6c 69 | 6e 65 20 3d 20 26 70 5b | cp->li|ne = &p[|
|000061c0| 31 5d 3b 0a 58 09 09 7d | 0a 58 09 09 70 2b 2b 3b |1];.X..}|.X..p++;|
|000061d0| 0a 58 09 20 20 20 20 7d | 0a 58 09 20 20 20 20 69 |.X. }|.X. i|
|000061e0| 66 20 28 63 70 2d 3e 78 | 6d 69 74 20 3e 3d 20 63 |f (cp->x|mit >= c|
|000061f0| 70 2d 3e 62 6c 65 6e 29 | 20 7b 0a 58 09 09 64 6f |p->blen)| {.X..do|
|00006200| 6e 65 2b 2b 3b 0a 58 09 | 09 63 6c 6f 73 65 28 63 |ne++;.X.|.close(c|
|00006210| 70 2d 3e 66 64 29 3b 0a | 58 23 69 66 20 64 65 62 |p->fd);.|X#if deb|
|00006220| 75 67 0a 58 09 66 70 72 | 69 6e 74 66 28 73 74 64 |ug.X.fpr|intf(std|
|00006230| 65 72 72 2c 20 22 63 68 | 69 6c 64 20 25 64 2c 20 |err, "ch|ild %d, |
|00006240| 63 6c 6f 73 65 20 73 74 | 64 20 69 6e 70 75 74 5c |close st|d input\|
|00006250| 6e 22 2c 20 69 29 3b 0a | 58 23 65 6e 64 69 66 0a |n", i);.|X#endif.|
|00006260| 58 09 20 20 20 20 7d 0a | 58 09 20 20 20 20 6f 75 |X. }.|X. ou|
|00006270| 74 70 75 74 20 2b 3d 20 | 6c 3b 0a 58 09 7d 0a 58 |tput += |l;.X.}.X|
|00006280| 09 77 68 69 6c 65 20 28 | 6f 75 74 70 75 74 20 3e |.while (|output >|
|00006290| 20 74 68 72 65 73 29 20 | 7b 0a 58 09 20 20 20 20 | thres) |{.X. |
|000062a0| 70 61 75 73 65 28 29 3b | 0a 58 23 69 66 20 64 65 |pause();|.X#if de|
|000062b0| 62 75 67 0a 58 09 20 20 | 20 20 66 70 72 69 6e 74 |bug.X. | fprint|
|000062c0| 66 28 73 74 64 65 72 72 | 2c 20 22 61 66 74 65 72 |f(stderr|, "after|
|000062d0| 20 70 61 75 73 65 3a 20 | 6f 75 74 70 75 74 2c 20 | pause: |output, |
|000062e0| 74 68 72 65 73 2c 20 64 | 6f 6e 65 20 25 64 20 25 |thres, d|one %d %|
|000062f0| 2e 32 66 20 25 64 5c 6e | 22 2c 20 6f 75 74 70 75 |.2f %d\n|", outpu|
|00006300| 74 2c 20 74 68 72 65 73 | 2c 20 64 6f 6e 65 29 3b |t, thres|, done);|
|00006310| 0a 58 23 65 6e 64 69 66 | 0a 58 09 7d 0a 58 20 20 |.X#endif|.X.}.X |
|00006320| 20 20 7d 0a 58 0a 58 62 | 65 70 61 74 69 65 6e 74 | }.X.Xb|epatient|
|00006330| 3a 0a 58 20 20 20 20 61 | 6c 61 72 6d 28 30 29 3b |:.X a|larm(0);|
|00006340| 0a 58 2f 2a 2a 2a 2a 0a | 58 20 2a 20 20 49 66 20 |.X/****.|X * If |
|00006350| 65 76 65 72 79 74 68 69 | 6e 67 20 69 73 20 67 6f |everythi|ng is go|
|00006360| 69 6e 67 20 4f 4b 2c 20 | 77 65 20 73 68 6f 75 6c |ing OK, |we shoul|
|00006370| 64 20 73 69 6d 70 6c 79 | 20 62 65 20 61 62 6c 65 |d simply| be able|
|00006380| 20 74 6f 20 6b 65 65 70 | 0a 58 20 2a 20 20 6c 6f | to keep|.X * lo|
|00006390| 6f 70 69 6e 67 20 75 6e | 69 74 69 6c 20 27 77 61 |oping un|itil 'wa|
|000063a0| 69 74 27 20 66 61 69 6c | 73 2c 20 68 6f 77 65 76 |it' fail|s, howev|
|000063b0| 65 72 20 73 6f 6d 65 20 | 64 65 73 63 65 6e 64 65 |er some |descende|
|000063c0| 6e 74 20 70 72 6f 63 65 | 73 73 20 6d 61 79 0a 58 |nt proce|ss may.X|
|000063d0| 20 2a 20 20 62 65 20 69 | 6e 20 61 20 73 74 61 74 | * be i|n a stat|
|000063e0| 65 20 66 72 6f 6d 20 77 | 68 69 63 68 20 69 74 20 |e from w|hich it |
|000063f0| 63 61 6e 20 6e 65 76 65 | 72 20 65 78 69 74 2c 20 |can neve|r exit, |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.