home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / byteunix.lzh / byte.3 < prev    next >
SHell self-extracting ARchive  |  1990-05-11  |  46.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: byte.3

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% 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 application/x-shellscript default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 23 20 54 68 |.#! /bin|/sh.# Th|
|00000010| 69 73 20 69 73 20 61 20 | 73 68 65 6c 6c 20 61 72 |is is a |shell ar|
|00000020| 63 68 69 76 65 2e 20 20 | 52 65 6d 6f 76 65 20 61 |chive. |Remove a|
|00000030| 6e 79 74 68 69 6e 67 20 | 62 65 66 6f 72 65 20 74 |nything |before t|
|00000040| 68 69 73 20 6c 69 6e 65 | 2c 20 74 68 65 6e 20 75 |his line|, then u|
|00000050| 6e 70 61 63 6b 0a 23 20 | 69 74 20 62 79 20 73 61 |npack.# |it by sa|
|00000060| 76 69 6e 67 20 69 74 20 | 69 6e 74 6f 20 61 20 66 |ving it |into a f|
|00000070| 69 6c 65 20 61 6e 64 20 | 74 79 70 69 6e 67 20 22 |ile and |typing "|
|00000080| 73 68 20 66 69 6c 65 22 | 2e 20 20 54 6f 20 6f 76 |sh file"|. To ov|
|00000090| 65 72 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |erwrite |existing|
|000000a0| 0a 23 20 66 69 6c 65 73 | 2c 20 74 79 70 65 20 22 |.# files|, type "|
|000000b0| 73 68 20 66 69 6c 65 20 | 2d 63 22 2e 20 20 59 6f |sh file |-c". Yo|
|000000c0| 75 20 63 61 6e 20 61 6c | 73 6f 20 66 65 65 64 20 |u can al|so feed |
|000000d0| 74 68 69 73 20 61 73 20 | 73 74 61 6e 64 61 72 64 |this as |standard|
|000000e0| 20 69 6e 70 75 74 20 76 | 69 61 0a 23 20 75 6e 73 | input v|ia.# uns|
|000000f0| 68 61 72 2c 20 6f 72 20 | 62 79 20 74 79 70 69 6e |har, or |by typin|
|00000100| 67 20 22 73 68 20 3c 66 | 69 6c 65 22 2c 20 65 2e |g "sh <f|ile", e.|
|00000110| 67 2e 2e 20 20 49 66 20 | 74 68 69 73 20 61 72 63 |g.. If |this arc|
|00000120| 68 69 76 65 20 69 73 20 | 63 6f 6d 70 6c 65 74 65 |hive is |complete|
|00000130| 2c 20 79 6f 75 0a 23 20 | 77 69 6c 6c 20 73 65 65 |, you.# |will see|
|00000140| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 6d | the fol|lowing m|
|00000150| 65 73 73 61 67 65 20 61 | 74 20 74 68 65 20 65 6e |essage a|t the en|
|00000160| 64 3a 0a 23 09 09 22 45 | 6e 64 20 6f 66 20 61 72 |d:.#.."E|nd of ar|
|00000170| 63 68 69 76 65 20 33 20 | 28 6f 66 20 35 29 2e 22 |chive 3 |(of 5)."|
|00000180| 0a 23 20 43 6f 6e 74 65 | 6e 74 73 3a 20 20 62 65 |.# Conte|nts: be|
|00000190| 6e 63 68 2e 64 6f 63 20 | 62 69 67 2e 63 20 64 62 |nch.doc |big.c db|
|000001a0| 6d 73 65 72 76 2e 63 0a | 23 20 57 72 61 70 70 65 |mserv.c.|# Wrappe|
|000001b0| 64 20 62 79 20 72 73 61 | 6c 7a 40 70 61 70 61 79 |d by rsa|lz@papay|
|000001c0| 61 2e 62 62 6e 2e 63 6f | 6d 20 6f 6e 20 54 75 65 |a.bbn.co|m on Tue|
|000001d0| 20 4d 61 79 20 20 38 20 | 30 38 3a 35 35 3a 33 32 | May 8 |08:55:32|
|000001e0| 20 31 39 39 30 0a 50 41 | 54 48 3d 2f 62 69 6e 3a | 1990.PA|TH=/bin:|
|000001f0| 2f 75 73 72 2f 62 69 6e | 3a 2f 75 73 72 2f 75 63 |/usr/bin|:/usr/uc|
|00000200| 62 20 3b 20 65 78 70 6f | 72 74 20 50 41 54 48 0a |b ; expo|rt PATH.|
|00000210| 69 66 20 74 65 73 74 20 | 2d 66 20 27 62 65 6e 63 |if test |-f 'benc|
|00000220| 68 2e 64 6f 63 27 20 2d | 61 20 22 24 7b 31 7d 22 |h.doc' -|a "${1}"|
|00000230| 20 21 3d 20 22 2d 63 22 | 20 3b 20 74 68 65 6e 20 | != "-c"| ; then |
|00000240| 0a 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 57 69 |. echo |shar: Wi|
|00000250| 6c 6c 20 6e 6f 74 20 63 | 6c 6f 62 62 65 72 20 65 |ll not c|lobber e|
|00000260| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 5c 22 27 |xisting |file \"'|
|00000270| 62 65 6e 63 68 2e 64 6f | 63 27 5c 22 0a 65 6c 73 |bench.do|c'\".els|
|00000280| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|00000290| 72 61 63 74 69 6e 67 20 | 5c 22 27 62 65 6e 63 68 |racting |\"'bench|
|000002a0| 2e 64 6f 63 27 5c 22 20 | 5c 28 31 34 36 38 32 20 |.doc'\" |\(14682 |
|000002b0| 63 68 61 72 61 63 74 65 | 72 73 5c 29 0a 73 65 64 |characte|rs\).sed|
|000002c0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 27 62 65 6e 63 | "s/^X//|" >'benc|
|000002d0| 68 2e 64 6f 63 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |h.doc' <|<'END_OF|
|000002e0| 5f 46 49 4c 45 27 0a 58 | 40 42 54 0a 58 0a 58 5b |_FILE'.X|@BT.X.X[|
|000002f0| 54 49 54 4c 45 5d 42 59 | 54 45 27 73 20 55 4e 49 |TITLE]BY|TE's UNI|
|00000300| 58 20 42 65 6e 63 68 6d | 61 72 6b 73 0a 58 5b 44 |X Benchm|arks.X[D|
|00000310| 45 4b 5d 53 65 70 61 72 | 61 74 69 6e 67 20 66 61 |EK]Separ|ating fa|
|00000320| 63 74 20 66 72 6f 6d 20 | 66 69 63 74 69 6f 6e 20 |ct from |fiction |
|00000330| 69 6e 20 74 68 65 20 65 | 78 70 6c 6f 64 69 6e 67 |in the e|xploding|
|00000340| 20 55 4e 49 58 20 65 6d | 70 69 72 65 0a 58 5b 54 | UNIX em|pire.X[T|
|00000350| 4f 43 5d 42 65 66 6f 72 | 65 20 79 6f 75 20 6a 75 |OC]Befor|e you ju|
|00000360| 6d 70 20 69 6e 74 6f 20 | 74 68 65 20 55 4e 49 58 |mp into |the UNIX|
|00000370| 20 70 6f 6f 6c 2c 20 73 | 65 65 20 68 6f 77 20 79 | pool, s|ee how y|
|00000380| 6f 75 72 20 66 61 76 6f | 72 69 74 65 20 73 79 73 |our favo|rite sys|
|00000390| 74 65 6d 20 73 74 61 63 | 6b 73 0a 58 75 70 20 61 |tem stac|ks.Xup a|
|000003a0| 67 61 69 6e 73 74 20 74 | 68 65 20 72 65 73 74 20 |gainst t|he rest |
|000003b0| 6f 66 20 74 68 65 20 70 | 61 63 6b 2e 0a 58 0a 58 |of the p|ack..X.X|
|000003c0| 42 65 6e 20 53 6d 69 74 | 68 0a 58 0a 58 49 6e 20 |Ben Smit|h.X.XIn |
|000003d0| 6d 61 6b 69 6e 67 20 70 | 75 72 63 68 61 73 65 20 |making p|urchase |
|000003e0| 64 65 63 69 73 69 6f 6e | 73 2c 20 69 74 27 73 20 |decision|s, it's |
|000003f0| 64 69 66 66 69 63 75 6c | 74 20 74 6f 20 6b 6e 6f |difficul|t to kno|
|00000400| 77 20 77 68 6f 6d 20 74 | 6f 20 62 65 6c 69 65 76 |w whom t|o believ|
|00000410| 65 2e 20 45 61 63 68 0a | 58 76 65 6e 64 6f 72 20 |e. Each.|Xvendor |
|00000420| 63 6c 61 69 6d 73 2c 20 | 70 72 65 64 69 63 74 61 |claims, |predicta|
|00000430| 62 6c 79 2c 20 74 68 61 | 74 20 74 68 65 69 72 20 |bly, tha|t their |
|00000440| 70 72 6f 64 75 63 74 73 | 20 61 72 65 20 62 65 74 |products| are bet|
|00000450| 74 65 72 20 74 68 61 6e | 20 74 68 65 0a 58 63 6f |ter than| the.Xco|
|00000460| 6d 70 65 74 69 74 69 6f | 6e 27 73 2c 20 62 75 74 |mpetitio|n's, but|
|00000470| 20 68 6f 77 20 64 6f 65 | 73 20 6f 6e 65 20 70 72 | how doe|s one pr|
|00000480| 6f 76 65 2c 20 6f 72 20 | 64 65 62 75 6e 6b 2c 20 |ove, or |debunk, |
|00000490| 74 68 65 73 65 20 63 6c | 61 69 6d 73 3f 0a 58 20 |these cl|aims?.X |
|000004a0| 20 43 6f 73 74 20 61 6e | 64 20 70 65 72 66 6f 72 | Cost an|d perfor|
|000004b0| 6d 61 6e 63 65 20 74 79 | 70 69 63 61 6c 6c 79 20 |mance ty|pically |
|000004c0| 74 6f 70 20 74 68 65 20 | 6c 69 73 74 20 6f 66 20 |top the |list of |
|000004d0| 63 6f 6e 73 69 64 65 72 | 61 74 69 6f 6e 73 20 66 |consider|ations f|
|000004e0| 6f 72 20 74 68 6f 73 65 | 0a 58 73 65 65 6b 69 6e |or those|.Xseekin|
|000004f0| 67 20 74 6f 20 70 75 72 | 63 68 61 73 65 20 65 71 |g to pur|chase eq|
|00000500| 75 69 70 6d 65 6e 74 2c | 20 61 6e 64 20 77 68 69 |uipment,| and whi|
|00000510| 6c 65 20 63 6f 73 74 20 | 63 61 6e 20 62 65 20 65 |le cost |can be e|
|00000520| 61 73 69 6c 79 20 63 6f | 6d 70 61 72 65 64 2c 0a |asily co|mpared,.|
|00000530| 58 70 65 72 66 6f 72 6d | 61 6e 63 65 20 63 61 6e |Xperform|ance can|
|00000540| 6e 6f 74 2c 20 61 6e 64 | 20 63 6f 6d 70 61 72 69 |not, and| compari|
|00000550| 6e 67 20 63 6f 73 74 73 | 20 77 69 74 68 6f 75 74 |ng costs| without|
|00000560| 20 61 6e 61 6c 79 7a 69 | 6e 67 20 65 61 63 68 20 | analyzi|ng each |
|00000570| 73 79 73 74 65 6d 27 73 | 0a 58 72 65 6c 61 74 69 |system's|.Xrelati|
|00000580| 76 65 20 76 61 6c 75 65 | 20 69 73 20 61 20 77 6f |ve value| is a wo|
|00000590| 72 74 68 6c 65 73 73 20 | 65 78 65 72 63 69 73 65 |rthless |exercise|
|000005a0| 2e 0a 58 20 20 57 68 65 | 6e 20 44 4f 53 20 62 65 |..X Whe|n DOS be|
|000005b0| 63 61 6d 65 20 70 6f 70 | 75 6c 61 72 2c 20 69 74 |came pop|ular, it|
|000005c0| 20 61 6c 6c 6f 77 65 64 | 20 66 6f 72 20 74 68 65 | allowed| for the|
|000005d0| 20 64 65 76 65 6c 6f 70 | 6d 65 6e 74 20 6f 66 20 | develop|ment of |
|000005e0| 70 65 72 66 6f 72 6d 61 | 6e 63 65 0a 58 6d 65 61 |performa|nce.Xmea|
|000005f0| 73 75 72 65 6d 65 6e 74 | 20 70 72 6f 67 72 61 6d |surement| program|
|00000600| 73 2c 20 62 65 6e 63 68 | 6d 61 72 6b 73 2c 20 74 |s, bench|marks, t|
|00000610| 68 61 74 20 77 6f 75 6c | 64 20 72 75 6e 20 6f 6e |hat woul|d run on|
|00000620| 20 61 6e 79 20 73 79 73 | 74 65 6d 20 74 68 61 74 | any sys|tem that|
|00000630| 20 72 61 6e 20 44 4f 53 | 2e 0a 58 42 59 54 45 27 | ran DOS|..XBYTE'|
|00000640| 73 20 6c 61 62 20 74 65 | 63 68 6e 69 63 69 61 6e |s lab te|chnician|
|00000650| 73 20 73 65 74 20 61 62 | 6f 75 74 20 63 72 65 61 |s set ab|out crea|
|00000660| 74 69 6e 67 20 74 68 65 | 69 72 20 6f 77 6e 2c 20 |ting the|ir own, |
|00000670| 61 6e 64 20 74 68 65 20 | 42 59 54 45 20 44 4f 53 |and the |BYTE DOS|
|00000680| 0a 58 62 65 6e 63 68 6d | 61 72 6b 73 20 77 65 72 |.Xbenchm|arks wer|
|00000690| 65 20 62 6f 72 6e 2e 20 | 44 6f 7a 65 6e 73 20 6f |e born. |Dozens o|
|000006a0| 66 20 73 79 73 74 65 6d | 73 20 68 61 76 65 20 62 |f system|s have b|
|000006b0| 65 65 6e 20 63 6c 6f 63 | 6b 65 64 20 75 73 69 6e |een cloc|ked usin|
|000006c0| 67 20 74 68 65 73 65 0a | 58 66 61 63 69 6c 69 74 |g these.|Xfacilit|
|000006d0| 69 65 73 2c 20 61 6e 64 | 20 65 61 63 68 20 72 65 |ies, and| each re|
|000006e0| 76 69 65 77 20 6f 66 20 | 61 20 6e 65 77 20 44 4f |view of |a new DO|
|000006f0| 53 2d 62 61 73 65 64 20 | 73 79 73 74 65 6d 20 69 |S-based |system i|
|00000700| 6e 63 6c 75 64 65 73 20 | 74 68 65 20 72 65 73 75 |ncludes |the resu|
|00000710| 6c 74 73 20 6f 66 0a 58 | 74 68 65 73 65 20 62 65 |lts of.X|these be|
|00000720| 6e 63 68 6d 61 72 6b 73 | 2e 0a 58 20 20 54 68 69 |nchmarks|..X Thi|
|00000730| 73 20 69 73 20 61 6c 6c | 20 76 65 72 79 20 77 65 |s is all| very we|
|00000740| 6c 6c 2c 20 62 75 74 20 | 77 68 69 6c 65 20 44 4f |ll, but |while DO|
|00000750| 53 20 69 73 20 69 6e 73 | 74 61 6c 6c 65 64 20 6f |S is ins|talled o|
|00000760| 6e 20 61 20 67 72 65 61 | 74 20 6d 61 6e 79 20 73 |n a grea|t many s|
|00000770| 79 73 74 65 6d 73 2c 0a | 58 69 74 20 69 73 20 6e |ystems,.|Xit is n|
|00000780| 6f 20 6c 6f 6e 67 65 72 | 20 74 68 65 20 21 49 54 |o longer| the !IT|
|00000790| 41 4c 21 6f 6e 6c 79 21 | 45 4e 44 49 54 41 4c 21 |AL!only!|ENDITAL!|
|000007a0| 20 70 6f 70 75 6c 61 72 | 20 6d 75 6c 74 69 2d 70 | popular| multi-p|
|000007b0| 6c 61 74 66 6f 72 6d 20 | 6f 70 65 72 61 74 69 6e |latform |operatin|
|000007c0| 67 0a 58 73 79 73 74 65 | 6d 2e 20 55 73 65 72 20 |g.Xsyste|m. User |
|000007d0| 64 65 6d 61 6e 64 73 20 | 66 6f 72 20 67 72 65 61 |demands |for grea|
|000007e0| 74 65 72 20 65 78 70 61 | 6e 64 61 62 69 6c 69 74 |ter expa|ndabilit|
|000007f0| 79 2c 20 62 65 74 74 65 | 72 20 70 65 72 66 6f 72 |y, bette|r perfor|
|00000800| 6d 61 6e 63 65 20 61 6e | 64 0a 58 6d 75 6c 74 69 |mance an|d.Xmulti|
|00000810| 2d 74 61 73 6b 69 6e 67 | 20 68 61 76 65 20 74 75 |-tasking| have tu|
|00000820| 72 6e 65 64 20 55 4e 49 | 58 20 73 79 73 74 65 6d |rned UNI|X system|
|00000830| 73 20 69 6e 74 6f 20 6f | 6e 65 20 6f 66 20 74 68 |s into o|ne of th|
|00000840| 65 20 66 61 73 74 65 73 | 74 20 67 72 6f 77 69 6e |e fastes|t growin|
|00000850| 67 0a 58 73 65 67 6d 65 | 6e 74 73 20 6f 66 20 74 |g.Xsegme|nts of t|
|00000860| 68 65 20 6d 61 72 6b 65 | 74 2e 20 57 68 65 6e 20 |he marke|t. When |
|00000870| 55 4e 49 58 20 73 74 65 | 70 70 65 64 20 66 72 6f |UNIX ste|pped fro|
|00000880| 6d 20 6d 69 6e 69 63 6f | 6d 70 75 74 65 72 73 20 |m minico|mputers |
|00000890| 74 6f 20 77 6f 72 6b 73 | 74 61 74 69 6f 6e 73 2c |to works|tations,|
|000008a0| 0a 58 69 74 20 65 73 74 | 61 62 6c 69 73 68 65 64 |.Xit est|ablished|
|000008b0| 20 69 74 73 65 6c 66 20 | 61 73 20 74 68 65 20 64 | itself |as the d|
|000008c0| 65 66 61 63 74 6f 20 4f | 53 20 66 6f 72 20 61 6e |efacto O|S for an|
|000008d0| 20 65 78 63 69 74 69 6e | 67 20 6e 65 77 20 62 72 | excitin|g new br|
|000008e0| 65 65 64 20 6f 66 20 6d | 61 63 68 69 6e 65 2e 0a |eed of m|achine..|
|000008f0| 58 4e 6f 77 2c 20 77 69 | 74 68 20 73 6f 6c 69 64 |XNow, wi|th solid|
|00000900| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 73 | impleme|ntations|
|00000910| 20 66 6f 72 20 61 66 66 | 6f 72 64 61 62 6c 65 20 | for aff|ordable |
|00000920| 49 6e 74 65 6c 20 61 6e | 64 20 4d 6f 74 6f 72 6f |Intel an|d Motoro|
|00000930| 6c 61 2d 62 61 73 65 64 | 0a 58 70 6c 61 74 66 6f |la-based|.Xplatfo|
|00000940| 72 6d 73 2c 20 55 4e 49 | 58 20 69 73 20 6d 61 6b |rms, UNI|X is mak|
|00000950| 69 6e 67 20 61 20 6e 61 | 6d 65 20 66 6f 72 20 69 |ing a na|me for i|
|00000960| 74 73 65 6c 66 20 69 6e | 20 74 68 65 20 50 43 20 |tself in| the PC |
|00000970| 72 65 61 6c 6d 2e 20 41 | 73 20 55 4e 49 58 20 66 |realm. A|s UNIX f|
|00000980| 69 6e 64 73 0a 58 69 74 | 73 20 77 61 79 20 69 6e |inds.Xit|s way in|
|00000990| 74 6f 20 74 68 65 20 6d | 61 69 6e 73 74 72 65 61 |to the m|ainstrea|
|000009a0| 6d 2c 20 69 74 20 69 73 | 20 6e 65 63 65 73 73 61 |m, it is| necessa|
|000009b0| 72 79 20 74 6f 20 68 61 | 76 65 20 74 68 65 20 74 |ry to ha|ve the t|
|000009c0| 6f 6f 6c 73 20 74 6f 20 | 6f 62 6a 65 63 74 69 76 |ools to |objectiv|
|000009d0| 65 6c 79 0a 58 6d 65 61 | 73 75 72 65 20 6e 6f 74 |ely.Xmea|sure not|
|000009e0| 20 6f 6e 6c 79 20 74 68 | 65 20 70 65 72 66 6f 72 | only th|e perfor|
|000009f0| 6d 61 6e 63 65 20 6f 66 | 20 76 61 72 69 6f 75 73 |mance of| various|
|00000a00| 20 68 61 72 64 77 61 72 | 65 20 70 6c 61 74 66 6f | hardwar|e platfo|
|00000a10| 72 6d 73 2c 20 62 75 74 | 20 6f 66 0a 58 64 69 66 |rms, but| of.Xdif|
|00000a20| 66 65 72 65 6e 74 20 76 | 65 72 73 69 6f 6e 73 20 |ferent v|ersions |
|00000a30| 6f 66 20 55 4e 49 58 20 | 61 73 20 77 65 6c 6c 2e |of UNIX |as well.|
|00000a40| 0a 58 0a 58 21 53 55 42 | 48 45 44 21 55 6e 69 78 |.X.X!SUB|HED!Unix|
|00000a50| 20 69 73 20 4e 6f 74 20 | 4d 53 2d 44 4f 53 21 45 | is Not |MS-DOS!E|
|00000a60| 4e 44 53 55 42 48 45 44 | 21 0a 58 43 6f 6e 63 65 |NDSUBHED|!.XConce|
|00000a70| 70 74 75 61 6c 6c 79 2c | 20 42 59 54 45 27 73 20 |ptually,| BYTE's |
|00000a80| 55 4e 49 58 20 62 65 6e | 63 68 6d 61 72 6b 73 20 |UNIX ben|chmarks |
|00000a90| 61 72 65 20 74 68 65 20 | 73 61 6d 65 20 61 73 20 |are the |same as |
|00000aa0| 42 59 54 45 27 73 20 4d | 53 2d 44 4f 53 0a 58 62 |BYTE's M|S-DOS.Xb|
|00000ab0| 65 6e 63 68 6d 61 72 6b | 73 3a 20 57 65 20 68 61 |enchmark|s: We ha|
|00000ac0| 76 65 20 63 6f 6d 62 69 | 6e 65 64 20 65 76 61 6c |ve combi|ned eval|
|00000ad0| 75 61 74 69 6f 6e 20 6f | 66 20 62 6f 74 68 20 6c |uation o|f both l|
|00000ae0| 6f 77 2d 6c 65 76 65 6c | 20 6f 70 65 72 61 74 69 |ow-level| operati|
|00000af0| 6f 6e 73 20 61 6e 64 0a | 58 68 69 67 68 2d 6c 65 |ons and.|Xhigh-le|
|00000b00| 76 65 6c 20 61 70 70 6c | 69 63 61 74 69 6f 6e 73 |vel appl|ications|
|00000b10| 20 74 79 70 65 20 70 72 | 6f 67 72 61 6d 73 20 74 | type pr|ograms t|
|00000b20| 6f 20 68 69 67 68 6c 69 | 67 68 74 20 74 68 65 20 |o highli|ght the |
|00000b30| 70 65 72 66 6f 72 6d 61 | 6e 63 65 20 6f 66 20 74 |performa|nce of t|
|00000b40| 68 65 0a 58 65 6e 74 69 | 72 65 20 73 79 73 74 65 |he.Xenti|re syste|
|00000b50| 6d 2e 0a 58 20 20 42 75 | 74 20 55 4e 49 58 20 69 |m..X Bu|t UNIX i|
|00000b60| 73 20 63 6f 6e 73 69 64 | 65 72 61 62 6c 79 20 64 |s consid|erably d|
|00000b70| 69 66 66 65 72 65 6e 74 | 20 66 72 6f 6d 20 4d 53 |ifferent| from MS|
|00000b80| 2d 44 4f 53 2e 20 49 6e | 20 74 68 65 20 66 69 72 |-DOS. In| the fir|
|00000b90| 73 74 20 70 6c 61 63 65 | 2c 20 69 74 20 69 73 20 |st place|, it is |
|00000ba0| 61 0a 58 21 49 54 41 4c | 21 6d 75 6c 74 69 21 45 |a.X!ITAL|!multi!E|
|00000bb0| 4e 44 49 54 41 4c 21 2d | 74 61 73 6b 69 6e 67 2c |NDITAL!-|tasking,|
|00000bc0| 20 21 49 54 41 4c 21 6d | 75 6c 74 69 21 45 4e 44 | !ITAL!m|ulti!END|
|00000bd0| 49 54 41 4c 21 2d 75 73 | 65 72 20 6f 70 65 72 61 |ITAL!-us|er opera|
|00000be0| 74 69 6e 67 20 73 79 73 | 74 65 6d 2e 20 49 74 0a |ting sys|tem. It.|
|00000bf0| 58 69 73 20 61 6c 73 6f | 20 70 6f 72 74 61 62 6c |Xis also| portabl|
|00000c00| 65 2c 20 61 62 6c 65 20 | 74 6f 20 72 75 6e 20 6f |e, able |to run o|
|00000c10| 6e 20 6d 61 6e 79 20 64 | 69 66 66 65 72 65 6e 74 |n many d|ifferent|
|00000c20| 20 6b 69 6e 64 73 20 6f | 66 20 63 6f 6d 70 75 74 | kinds o|f comput|
|00000c30| 65 72 73 2e 20 4d 53 2d | 44 4f 53 20 69 73 0a 58 |ers. MS-|DOS is.X|
|00000c40| 61 20 21 49 54 41 4c 21 | 73 69 6e 67 6c 65 21 45 |a !ITAL!|single!E|
|00000c50| 4e 44 49 54 41 4c 21 2d | 74 61 73 6b 69 6e 67 2c |NDITAL!-|tasking,|
|00000c60| 20 21 49 54 41 4c 21 73 | 69 6e 67 6c 65 21 45 4e | !ITAL!s|ingle!EN|
|00000c70| 44 49 54 41 4c 21 2d 75 | 73 65 72 20 6f 70 65 72 |DITAL!-u|ser oper|
|00000c80| 61 74 69 6e 67 20 73 79 | 73 74 65 6d 2c 0a 58 61 |ating sy|stem,.Xa|
|00000c90| 6e 64 20 69 74 20 69 73 | 20 69 6e 74 65 6e 64 65 |nd it is| intende|
|00000ca0| 64 20 74 6f 20 72 75 6e | 20 6f 6e 20 65 73 73 65 |d to run| on esse|
|00000cb0| 6e 74 69 61 6c 6c 79 20 | 6f 6e 65 20 6b 69 6e 64 |ntially |one kind|
|00000cc0| 20 6f 66 20 63 6f 6d 70 | 75 74 65 72 2c 20 61 6e | of comp|uter, an|
|00000cd0| 20 49 42 4d 2d 50 43 20 | 6f 72 0a 58 50 43 20 60 | IBM-PC |or.XPC `|
|00000ce0| 60 63 6c 6f 6e 65 2c 27 | 27 20 75 74 69 6c 69 7a |`clone,'|' utiliz|
|00000cf0| 69 6e 67 20 61 20 73 70 | 65 63 69 66 69 63 20 63 |ing a sp|ecific c|
|00000d00| 6c 61 73 73 20 6f 66 20 | 70 72 6f 63 65 73 73 6f |lass of |processo|
|00000d10| 72 20 66 72 6f 6d 20 49 | 6e 74 65 6c 2e 20 41 73 |r from I|ntel. As|
|00000d20| 20 61 0a 58 72 65 73 75 | 6c 74 2c 20 74 68 65 20 | a.Xresu|lt, the |
|00000d30| 55 4e 49 58 20 62 65 6e | 63 68 6d 61 72 6b 73 20 |UNIX ben|chmarks |
|00000d40| 64 69 66 66 65 72 20 66 | 72 6f 6d 20 74 68 65 69 |differ f|rom thei|
|00000d50| 72 20 4d 53 2d 44 4f 53 | 20 63 6f 75 6e 74 65 72 |r MS-DOS| counter|
|00000d60| 70 61 72 74 73 2e 20 45 | 76 65 6e 0a 58 74 68 6f |parts. E|ven.Xtho|
|00000d70| 75 67 68 20 74 68 65 72 | 65 20 61 72 65 20 73 6f |ugh ther|e are so|
|00000d80| 6d 65 20 65 71 75 69 76 | 61 6c 65 6e 74 20 6c 6f |me equiv|alent lo|
|00000d90| 77 2d 6c 65 76 65 6c 20 | 74 65 73 74 73 2c 20 79 |w-level |tests, y|
|00000da0| 6f 75 20 77 69 6c 6c 20 | 66 69 6e 64 20 74 68 61 |ou will |find tha|
|00000db0| 74 20 65 76 65 6e 0a 58 | 74 68 65 73 65 20 72 75 |t even.X|these ru|
|00000dc0| 6e 20 64 69 66 66 65 72 | 65 6e 74 6c 79 3b 20 74 |n differ|ently; t|
|00000dd0| 68 65 20 70 6f 70 75 6c | 61 72 20 44 68 72 79 73 |he popul|ar Dhrys|
|00000de0| 74 6f 6e 65 20 62 65 6e | 63 68 6d 61 72 6b 20 63 |tone ben|chmark c|
|00000df0| 6f 6d 6d 6f 6e 6c 79 20 | 67 69 76 65 73 0a 58 64 |ommonly |gives.Xd|
|00000e00| 69 66 66 65 72 65 6e 74 | 20 72 65 73 75 6c 74 73 |ifferent| results|
|00000e10| 2c 20 6f 6e 20 74 68 65 | 20 73 61 6d 65 20 68 61 |, on the| same ha|
|00000e20| 72 64 77 61 72 65 2c 20 | 77 68 65 6e 20 72 75 6e |rdware, |when run|
|00000e30| 20 75 6e 64 65 72 20 62 | 6f 74 68 20 44 4f 53 20 | under b|oth DOS |
|00000e40| 61 6e 64 20 55 4e 49 58 | 2e 0a 58 54 68 65 20 72 |and UNIX|..XThe r|
|00000e50| 65 61 73 6f 6e 3f 20 44 | 69 66 66 65 72 65 6e 74 |eason? D|ifferent|
|00000e60| 20 63 6f 6d 70 69 6c 65 | 72 73 20 61 72 65 20 62 | compile|rs are b|
|00000e70| 65 69 6e 67 20 75 73 65 | 64 2c 20 61 6e 64 20 74 |eing use|d, and t|
|00000e80| 68 65 20 75 6e 64 65 72 | 6c 79 69 6e 67 20 6f 70 |he under|lying op|
|00000e90| 65 72 61 74 69 6e 67 0a | 58 73 79 73 74 65 6d 73 |erating.|Xsystems|
|00000ea0| 20 61 6e 64 20 73 65 72 | 76 69 63 65 73 20 61 72 | and ser|vices ar|
|00000eb0| 65 20 77 69 6c 64 6c 79 | 20 64 69 66 66 65 72 65 |e wildly| differe|
|00000ec0| 6e 74 2e 0a 58 20 20 41 | 6e 6f 74 68 65 72 20 69 |nt..X A|nother i|
|00000ed0| 6d 70 6f 72 74 61 6e 74 | 20 64 69 66 66 65 72 65 |mportant| differe|
|00000ee0| 6e 63 65 20 69 73 20 74 | 68 61 74 20 4d 69 63 72 |nce is t|hat Micr|
|00000ef0| 6f 73 6f 66 74 20 69 73 | 20 74 68 65 20 6f 6e 6c |osoft is| the onl|
|00000f00| 79 20 72 65 61 6c 20 73 | 6f 75 72 63 65 20 6f 66 |y real s|ource of|
|00000f10| 0a 58 44 4f 53 3b 20 6f | 74 68 65 72 20 73 75 70 |.XDOS; o|ther sup|
|00000f20| 70 6c 69 65 72 73 20 73 | 69 6d 70 6c 79 20 72 65 |pliers s|imply re|
|00000f30| 70 61 63 6b 61 67 65 20 | 4d 69 63 72 6f 73 6f 66 |package |Microsof|
|00000f40| 74 27 73 20 62 61 73 69 | 63 20 6f 70 65 72 61 74 |t's basi|c operat|
|00000f50| 69 6e 67 20 73 79 73 74 | 65 6d 0a 58 75 6e 64 65 |ing syst|em.Xunde|
|00000f60| 72 20 6f 74 68 65 72 20 | 6e 61 6d 65 73 2e 20 49 |r other |names. I|
|00000f70| 6e 20 63 6f 6e 74 72 61 | 73 74 2c 20 74 68 65 72 |n contra|st, ther|
|00000f80| 65 20 61 72 65 20 6d 61 | 6e 79 20 64 69 66 66 65 |e are ma|ny diffe|
|00000f90| 72 65 6e 74 20 6b 69 6e | 64 73 20 6f 66 20 55 4e |rent kin|ds of UN|
|00000fa0| 49 58 2c 20 61 6e 64 0a | 58 77 68 69 6c 65 20 73 |IX, and.|Xwhile s|
|00000fb0| 69 6d 69 6c 61 72 69 74 | 69 65 73 20 65 78 69 73 |imilarit|ies exis|
|00000fc0| 74 20 28 74 68 65 20 63 | 6f 72 65 20 55 4e 49 58 |t (the c|ore UNIX|
|00000fd0| 20 66 72 6f 6d 20 44 65 | 6c 6c 2c 20 45 76 65 72 | from De|ll, Ever|
|00000fe0| 65 78 20 61 6e 64 20 49 | 6e 74 65 72 61 63 74 69 |ex and I|nteracti|
|00000ff0| 76 65 0a 58 53 79 73 74 | 65 6d 73 20 61 72 65 20 |ve.XSyst|ems are |
|00001000| 76 69 72 74 75 61 6c 6c | 79 20 74 68 65 20 73 61 |virtuall|y the sa|
|00001010| 6d 65 29 2c 20 74 68 65 | 72 65 20 61 72 65 20 55 |me), the|re are U|
|00001020| 4e 49 58 20 61 6e 64 20 | 55 4e 49 58 2d 6c 69 6b |NIX and |UNIX-lik|
|00001030| 65 20 6f 70 65 72 61 74 | 69 6e 67 0a 58 73 79 73 |e operat|ing.Xsys|
|00001040| 74 65 6d 73 20 74 68 61 | 74 20 64 69 66 66 65 72 |tems tha|t differ|
|00001050| 20 67 72 65 61 74 6c 79 | 20 66 72 6f 6d 20 6f 6e | greatly| from on|
|00001060| 65 20 61 6e 6f 74 68 65 | 72 2e 20 43 6f 6e 63 6c |e anothe|r. Concl|
|00001070| 75 73 69 6f 6e 3a 20 54 | 68 65 20 55 4e 49 58 20 |usion: T|he UNIX |
|00001080| 62 65 6e 63 68 6d 61 72 | 6b 73 0a 58 61 72 65 20 |benchmar|ks.Xare |
|00001090| 65 76 61 6c 75 61 74 69 | 6e 67 20 74 68 65 20 69 |evaluati|ng the i|
|000010a0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 6f 66 |mplement|ation of|
|000010b0| 20 55 4e 49 58 20 61 6e | 64 20 74 68 65 20 72 65 | UNIX an|d the re|
|000010c0| 73 69 64 65 6e 74 20 63 | 6f 6d 70 69 6c 65 72 20 |sident c|ompiler |
|000010d0| 61 73 20 77 65 6c 6c 0a | 58 61 73 20 74 68 65 20 |as well.|Xas the |
|000010e0| 68 61 72 64 77 61 72 65 | 20 6f 6e 20 77 68 69 63 |hardware| on whic|
|000010f0| 68 20 69 74 20 69 73 20 | 72 75 6e 6e 69 6e 67 20 |h it is |running |
|00001100| 28 74 68 65 20 4d 53 2d | 44 4f 53 20 61 6e 64 20 |(the MS-|DOS and |
|00001110| 41 70 70 6c 65 20 4d 61 | 63 69 6e 74 6f 73 68 0a |Apple Ma|cintosh.|
|00001120| 58 62 65 6e 63 68 6d 61 | 72 6b 73 20 75 73 65 20 |Xbenchma|rks use |
|00001130| 61 20 63 6f 6d 6d 6f 6e | 20 63 6f 6d 70 69 6c 65 |a common| compile|
|00001140| 72 2c 20 74 68 65 20 70 | 75 62 6c 69 63 2d 64 6f |r, the p|ublic-do|
|00001150| 6d 61 69 6e 20 53 6d 61 | 6c 6c 20 43 29 2e 0a 58 |main Sma|ll C)..X|
|00001160| 20 20 57 69 74 68 20 73 | 6f 20 6d 61 6e 79 20 76 | With s|o many v|
|00001170| 61 72 69 61 62 6c 65 73 | 2c 20 77 68 61 74 20 69 |ariables|, what i|
|00001180| 73 20 63 6f 6e 73 74 61 | 6e 74 3f 20 57 65 6c 6c |s consta|nt? Well|
|00001190| 2c 20 77 65 20 68 61 76 | 65 20 65 73 74 61 62 6c |, we hav|e establ|
|000011a0| 69 73 68 65 64 20 61 0a | 58 62 61 73 65 6c 69 6e |ished a.|Xbaselin|
|000011b0| 65 2c 20 53 43 4f 20 58 | 65 6e 69 78 20 33 38 36 |e, SCO X|enix 386|
|000011c0| 20 76 65 72 73 69 6f 6e | 20 32 2e 33 2e 31 2e 20 | version| 2.3.1. |
|000011d0| 72 75 6e 6e 69 6e 67 20 | 6f 6e 20 74 68 65 20 45 |running |on the E|
|000011e0| 76 65 72 65 78 20 33 38 | 36 2f 33 33 20 77 69 74 |verex 38|6/33 wit|
|000011f0| 68 20 34 0a 58 4d 62 79 | 74 65 73 20 6f 66 20 52 |h 4.XMby|tes of R|
|00001200| 41 4d 20 61 6e 64 20 61 | 6e 20 38 30 33 38 37 20 |AM and a|n 80387 |
|00001210| 6d 61 74 68 20 63 6f 70 | 72 6f 63 65 73 73 6f 72 |math cop|rocessor|
|00001220| 2e 20 57 68 69 6c 65 20 | 69 74 20 69 73 6e 27 74 |. While |it isn't|
|00001230| 20 55 4e 49 58 20 70 65 | 72 20 73 65 0a 58 28 62 | UNIX pe|r se.X(b|
|00001240| 65 63 61 75 73 65 20 41 | 54 26 54 20 64 65 63 69 |ecause A|T&T deci|
|00001250| 64 65 73 20 77 68 69 63 | 68 20 69 6d 70 6c 65 6d |des whic|h implem|
|00001260| 65 6e 74 61 74 69 6f 6e | 73 20 6d 61 79 20 62 65 |entation|s may be|
|00001270| 20 63 61 6c 6c 65 64 20 | 60 60 55 4e 49 58 27 27 | called |``UNIX''|
|00001280| 29 2c 20 69 74 20 69 73 | 0a 58 6d 6f 72 65 20 70 |), it is|.Xmore p|
|00001290| 6f 70 75 6c 61 72 20 74 | 68 61 6e 20 61 6e 79 20 |opular t|han any |
|000012a0| 6f 74 68 65 72 20 50 43 | 20 55 4e 49 58 20 69 6d |other PC| UNIX im|
|000012b0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 2e 20 49 74 |plementa|tion. It|
|000012c0| 20 69 73 20 73 70 65 63 | 69 66 69 63 61 6c 6c 79 | is spec|ifically|
|000012d0| 0a 58 64 65 73 69 67 6e | 65 64 20 66 6f 72 20 38 |.Xdesign|ed for 8|
|000012e0| 30 33 38 36 2d 62 61 73 | 65 64 20 63 6f 6d 70 75 |0386-bas|ed compu|
|000012f0| 74 65 72 73 20 77 69 74 | 68 20 66 75 6c 6c 20 33 |ters wit|h full 3|
|00001300| 32 20 62 69 74 20 6d 65 | 6d 6f 72 79 20 61 63 63 |2 bit me|mory acc|
|00001310| 65 73 73 2e 20 54 68 65 | 20 45 76 65 72 65 78 0a |ess. The| Everex.|
|00001320| 58 33 38 36 2f 33 33 20 | 77 61 73 20 63 68 6f 73 |X386/33 |was chos|
|00001330| 65 6e 20 62 65 63 61 75 | 73 65 20 69 74 20 69 73 |en becau|se it is|
|00001340| 20 6f 6e 65 20 6f 66 20 | 74 6f 64 61 79 27 73 20 | one of |today's |
|00001350| 68 69 67 68 65 73 74 20 | 70 65 72 66 6f 72 6d 61 |highest |performa|
|00001360| 6e 63 65 20 33 38 36 0a | 58 63 6f 6d 70 75 74 65 |nce 386.|Xcompute|
|00001370| 72 73 20 70 72 6f 70 65 | 72 6c 79 20 63 6f 6e 66 |rs prope|rly conf|
|00001380| 69 67 75 72 65 64 20 74 | 6f 20 72 75 6e 20 74 68 |igured t|o run th|
|00001390| 65 20 66 75 6c 6c 20 33 | 32 20 62 69 74 20 6f 70 |e full 3|2 bit op|
|000013a0| 65 72 61 74 69 6e 67 20 | 73 79 73 74 65 6d 2e 20 |erating |system. |
|000013b0| 28 53 6f 6d 65 0a 58 33 | 38 36 20 63 6f 6d 70 75 |(Some.X3|86 compu|
|000013c0| 74 65 72 73 20 63 61 6e | 6e 6f 74 20 61 63 63 65 |ters can|not acce|
|000013d0| 73 73 20 6d 65 6d 6f 72 | 79 20 74 68 72 6f 75 67 |ss memor|y throug|
|000013e0| 68 20 73 69 6e 67 6c 65 | 20 33 32 20 62 69 74 20 |h single| 32 bit |
|000013f0| 6f 70 65 72 61 74 69 6f | 6e 73 3b 20 73 6d 61 6c |operatio|ns; smal|
|00001400| 6c 0a 58 6d 61 74 74 65 | 72 20 69 66 20 79 6f 75 |l.Xmatte|r if you|
|00001410| 20 61 72 65 20 6a 75 73 | 74 20 72 75 6e 6e 69 6e | are jus|t runnin|
|00001420| 67 20 4d 53 2d 44 4f 53 | 2c 20 61 6e 20 38 20 62 |g MS-DOS|, an 8 b|
|00001430| 69 74 20 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |it opera|ting sys|
|00001440| 74 65 6d 2c 20 62 75 74 | 20 73 65 72 69 6f 75 73 |tem, but| serious|
|00001450| 0a 58 69 66 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |.Xif you| want to|
|00001460| 20 72 75 6e 20 55 4e 49 | 58 2e 29 20 54 68 69 73 | run UNI|X.) This|
|00001470| 20 63 6f 6d 62 69 6e 61 | 74 69 6f 6e 20 6f 66 20 | combina|tion of |
|00001480| 73 79 73 74 65 6d 20 61 | 6e 64 20 4f 53 20 69 73 |system a|nd OS is|
|00001490| 20 74 69 6d 65 6c 79 2c | 20 62 75 74 0a 58 77 65 | timely,| but.Xwe|
|000014a0| 27 6c 6c 20 63 6f 6e 74 | 69 6e 75 65 20 74 6f 20 |'ll cont|inue to |
|000014b0| 61 64 6a 75 73 74 20 74 | 68 65 20 62 61 73 65 6c |adjust t|he basel|
|000014c0| 69 6e 65 20 61 73 20 6e | 65 65 64 65 64 20 74 6f |ine as n|eeded to|
|000014d0| 20 72 65 66 6c 65 63 74 | 20 74 68 65 20 69 6e 73 | reflect| the ins|
|000014e0| 74 61 6c 6c 65 64 20 50 | 43 0a 58 61 6e 64 20 77 |talled P|C.Xand w|
|000014f0| 6f 72 6b 73 74 61 74 69 | 6f 6e 20 55 4e 49 58 20 |orkstati|on UNIX |
|00001500| 62 61 73 65 2e 0a 58 0a | 58 21 53 55 42 48 45 44 |base..X.|X!SUBHED|
|00001510| 21 54 68 65 20 4c 6f 77 | 20 4c 65 76 65 6c 20 42 |!The Low| Level B|
|00001520| 65 6e 63 68 20 50 72 6f | 67 72 61 6d 73 21 45 4e |ench Pro|grams!EN|
|00001530| 44 53 55 42 48 45 44 21 | 0a 58 54 68 65 20 42 59 |DSUBHED!|.XThe BY|
|00001540| 54 45 20 55 4e 49 58 20 | 62 65 6e 63 68 6d 61 72 |TE UNIX |benchmar|
|00001550| 6b 73 20 63 6f 6e 73 69 | 73 74 20 6f 66 20 65 69 |ks consi|st of ei|
|00001560| 67 68 74 20 67 72 6f 75 | 70 73 20 6f 66 20 70 72 |ght grou|ps of pr|
|00001570| 6f 67 72 61 6d 73 3a 20 | 61 72 69 74 68 6d 65 74 |ograms: |arithmet|
|00001580| 69 63 2c 0a 58 73 79 73 | 74 65 6d 20 63 61 6c 6c |ic,.Xsys|tem call|
|00001590| 73 2c 20 6d 65 6d 6f 72 | 79 20 6f 70 65 72 61 74 |s, memor|y operat|
|000015a0| 69 6f 6e 73 2c 20 64 69 | 73 6b 20 6f 70 65 72 61 |ions, di|sk opera|
|000015b0| 74 69 6f 6e 73 2c 20 64 | 68 72 79 73 74 6f 6e 65 |tions, d|hrystone|
|000015c0| 2c 20 64 61 74 61 62 61 | 73 65 0a 58 6f 70 65 72 |, databa|se.Xoper|
|000015d0| 61 74 69 6f 6e 73 2c 20 | 73 79 73 74 65 6d 20 6c |ations, |system l|
|000015e0| 6f 61 64 69 6e 67 2c 20 | 61 6e 64 20 6d 69 73 63 |oading, |and misc|
|000015f0| 65 6c 6c 61 6e 65 6f 75 | 73 2e 20 54 68 65 73 65 |ellaneou|s. These|
|00001600| 20 63 61 6e 20 62 65 20 | 72 6f 75 67 68 6c 79 20 | can be |roughly |
|00001610| 64 69 76 69 64 65 64 0a | 58 69 6e 74 6f 20 74 68 |divided.|Xinto th|
|00001620| 65 20 6c 6f 77 2d 6c 65 | 76 65 6c 20 74 65 73 74 |e low-le|vel test|
|00001630| 73 20 28 61 72 69 74 68 | 6d 65 74 69 63 2c 20 73 |s (arith|metic, s|
|00001640| 79 73 74 65 6d 20 63 61 | 6c 6c 73 2c 20 6d 65 6d |ystem ca|lls, mem|
|00001650| 6f 72 79 2c 20 64 69 73 | 6b 2c 20 61 6e 64 0a 58 |ory, dis|k, and.X|
|00001660| 64 68 72 79 73 74 6f 6e | 65 29 20 61 6e 64 20 68 |dhryston|e) and h|
|00001670| 69 67 68 2d 6c 65 76 65 | 6c 20 74 65 73 74 73 20 |igh-leve|l tests |
|00001680| 28 64 61 74 61 62 61 73 | 65 20 6f 70 65 72 61 74 |(databas|e operat|
|00001690| 69 6f 6e 73 2c 20 73 79 | 73 74 65 6d 20 6c 6f 61 |ions, sy|stem loa|
|000016a0| 64 69 6e 67 2c 20 61 6e | 64 20 74 68 65 0a 58 43 |ding, an|d the.XC|
|000016b0| 2d 63 6f 6d 70 69 6c 65 | 72 20 74 65 73 74 20 74 |-compile|r test t|
|000016c0| 68 61 74 20 69 73 20 70 | 61 72 74 20 6f 66 20 74 |hat is p|art of t|
|000016d0| 68 65 20 6d 69 73 63 65 | 6c 6c 61 6e 65 6f 75 73 |he misce|llaneous|
|000016e0| 20 73 65 74 29 2e 0a 58 | 20 20 54 68 65 20 44 68 | set)..X| The Dh|
|000016f0| 72 79 73 74 6f 6e 65 20 | 74 65 73 74 20 69 73 20 |rystone |test is |
|00001700| 6b 6e 6f 77 6e 20 6d 6f | 72 65 20 66 6f 72 6d 61 |known mo|re forma|
|00001710| 6c 6c 79 20 61 73 20 60 | 60 44 68 72 79 73 74 6f |lly as `|`Dhrysto|
|00001720| 6e 65 20 32 27 27 2e 20 | 49 74 20 70 65 72 66 6f |ne 2''. |It perfo|
|00001730| 72 6d 73 0a 58 6e 6f 20 | 66 6c 6f 61 74 69 6e 67 |rms.Xno |floating|
|00001740| 2d 70 6f 69 6e 74 20 6f | 70 65 72 61 74 69 6f 6e |-point o|peration|
|00001750| 73 2c 20 62 75 74 20 69 | 74 20 64 6f 65 73 20 69 |s, but i|t does i|
|00001760| 6e 76 6f 6c 76 65 20 61 | 72 72 61 79 73 2c 20 63 |nvolve a|rrays, c|
|00001770| 68 61 72 61 63 74 65 72 | 20 73 74 72 69 6e 67 73 |haracter| strings|
|00001780| 2c 0a 58 69 6e 64 69 72 | 65 63 74 20 61 64 64 72 |,.Xindir|ect addr|
|00001790| 65 73 73 69 6e 67 2c 20 | 61 6e 64 20 6d 6f 73 74 |essing, |and most|
|000017a0| 20 6f 66 20 74 68 65 20 | 6e 6f 6e 2d 66 6c 6f 61 | of the |non-floa|
|000017b0| 74 69 6e 67 20 70 6f 69 | 6e 74 20 69 6e 73 74 72 |ting poi|nt instr|
|000017c0| 75 63 74 69 6f 6e 73 20 | 74 68 61 74 0a 58 6d 69 |uctions |that.Xmi|
|000017d0| 67 68 74 20 62 65 20 66 | 6f 75 6e 64 20 69 6e 20 |ght be f|ound in |
|000017e0| 61 6e 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 70 |an appli|cation p|
|000017f0| 72 6f 67 72 61 6d 2e 20 | 49 74 20 61 6c 73 6f 20 |rogram. |It also |
|00001800| 69 6e 63 6c 75 64 65 73 | 20 63 6f 6e 64 69 74 69 |includes| conditi|
|00001810| 6f 6e 61 6c 0a 58 6f 70 | 65 72 61 74 69 6f 6e 73 |onal.Xop|erations|
|00001820| 20 61 6e 64 20 6f 74 68 | 65 72 20 63 6f 6d 6d 6f | and oth|er commo|
|00001830| 6e 20 70 72 6f 67 72 61 | 6d 20 66 6c 6f 77 20 63 |n progra|m flow c|
|00001840| 6f 6e 74 72 6f 6c 73 2e | 20 54 68 65 20 6f 75 74 |ontrols.| The out|
|00001850| 70 75 74 20 6f 66 20 74 | 68 65 20 74 65 73 74 20 |put of t|he test |
|00001860| 69 73 0a 58 74 68 65 20 | 6e 75 6d 62 65 72 20 6f |is.Xthe |number o|
|00001870| 66 20 64 68 72 79 73 74 | 6f 6e 65 20 6c 6f 6f 70 |f dhryst|one loop|
|00001880| 73 20 70 65 72 20 73 65 | 63 6f 6e 64 2e 20 49 74 |s per se|cond. It|
|00001890| 20 69 73 20 75 73 65 64 | 20 69 6e 20 74 68 65 20 | is used| in the |
|000018a0| 42 59 54 45 20 62 65 6e | 63 68 6d 61 72 6b 73 0a |BYTE ben|chmarks.|
|000018b0| 58 62 65 63 61 75 73 65 | 20 6f 66 20 69 74 73 20 |Xbecause| of its |
|000018c0| 77 69 64 65 20 73 65 6c | 65 63 74 69 6f 6e 20 6f |wide sel|ection o|
|000018d0| 66 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 61 6e 64 |f operat|ions and|
|000018e0| 20 62 65 63 61 75 73 65 | 20 69 74 20 69 73 20 6f | because| it is o|
|000018f0| 6e 65 20 6f 66 20 74 68 | 65 20 6d 6f 73 74 0a 58 |ne of th|e most.X|
|00001900| 77 69 64 65 6c 79 20 72 | 75 6e 20 62 65 6e 63 68 |widely r|un bench|
|00001910| 6d 61 72 6b 20 70 72 6f | 67 72 61 6d 73 2e 0a 58 |mark pro|grams..X|
|00001920| 20 20 41 20 66 75 74 75 | 72 65 20 76 65 72 73 69 | A futu|re versi|
|00001930| 6f 6e 20 6f 66 20 74 68 | 65 20 42 59 54 45 20 55 |on of th|e BYTE U|
|00001940| 4e 49 58 20 62 65 6e 63 | 68 6d 61 72 6b 73 20 77 |NIX benc|hmarks w|
|00001950| 69 6c 6c 20 69 6e 63 6c | 75 64 65 20 74 68 65 20 |ill incl|ude the |
|00001960| 57 68 65 74 73 74 6f 6e | 65 0a 58 62 65 6e 63 68 |Whetston|e.Xbench|
|00001970| 6d 61 72 6b 20 74 65 73 | 74 20 70 72 6f 67 72 61 |mark tes|t progra|
|00001980| 6d 2c 20 61 73 20 77 65 | 6c 6c 2e 20 54 68 65 20 |m, as we|ll. The |
|00001990| 57 68 65 74 73 74 6f 6e | 65 20 62 65 6e 63 68 6d |Whetston|e benchm|
|000019a0| 61 72 6b 20 69 73 20 63 | 6f 6e 63 65 70 74 75 61 |ark is c|onceptua|
|000019b0| 6c 6c 79 0a 58 73 69 6d | 69 6c 61 72 20 74 6f 20 |lly.Xsim|ilar to |
|000019c0| 74 68 65 20 44 68 72 79 | 73 74 6f 6e 65 2c 20 62 |the Dhry|stone, b|
|000019d0| 75 74 20 77 69 74 68 20 | 61 6e 20 65 6d 70 68 61 |ut with |an empha|
|000019e0| 73 69 73 20 6f 6e 20 6d | 61 74 68 3b 20 69 74 20 |sis on m|ath; it |
|000019f0| 69 73 20 61 20 6d 69 78 | 20 6f 66 0a 58 66 6c 6f |is a mix| of.Xflo|
|00001a00| 61 74 69 6e 67 20 70 6f | 69 6e 74 20 61 6e 64 20 |ating po|int and |
|00001a10| 69 6e 74 65 67 65 72 20 | 61 72 69 74 68 6d 65 74 |integer |arithmet|
|00001a20| 69 63 2c 20 66 75 6e 63 | 74 69 6f 6e 20 63 61 6c |ic, func|tion cal|
|00001a30| 6c 73 2c 20 61 72 72 61 | 79 20 6f 70 65 72 61 74 |ls, arra|y operat|
|00001a40| 69 6f 6e 73 2c 0a 58 63 | 6f 6e 64 69 74 69 6f 6e |ions,.Xc|ondition|
|00001a50| 61 6c 73 2c 20 61 6e 64 | 20 74 72 61 6e 73 63 65 |als, and| transce|
|00001a60| 6e 64 65 6e 74 61 6c 20 | 66 75 6e 63 74 69 6f 6e |ndental |function|
|00001a70| 20 63 61 6c 6c 73 2e 0a | 58 20 20 41 6c 6c 20 74 | calls..|X All t|
|00001a80| 68 65 20 61 72 69 74 68 | 6d 65 74 69 63 20 74 65 |he arith|metic te|
|00001a90| 73 74 73 20 68 61 76 65 | 20 74 68 65 20 73 61 6d |sts have| the sam|
|00001aa0| 65 20 73 6f 75 72 63 65 | 20 63 6f 64 65 20 77 69 |e source| code wi|
|00001ab0| 74 68 20 64 69 66 66 65 | 72 65 6e 74 20 64 61 74 |th diffe|rent dat|
|00001ac0| 61 0a 58 74 79 70 65 73 | 20 73 75 62 73 74 69 74 |a.Xtypes| substit|
|00001ad0| 75 74 65 64 20 66 6f 72 | 20 74 68 65 20 6f 70 65 |uted for| the ope|
|00001ae0| 72 61 74 69 6f 6e 73 3a | 20 72 65 67 69 73 74 65 |rations:| registe|
|00001af0| 72 2c 20 73 68 6f 72 74 | 2c 20 69 6e 74 2c 20 6c |r, short|, int, l|
|00001b00| 6f 6e 67 2c 20 66 6c 6f | 61 74 2c 0a 58 64 6f 75 |ong, flo|at,.Xdou|
|00001b10| 62 6c 65 2c 20 61 6e 64 | 20 61 6e 20 65 6d 70 74 |ble, and| an empt|
|00001b20| 79 20 6c 6f 6f 70 20 66 | 6f 72 20 63 61 6c 63 75 |y loop f|or calcu|
|00001b30| 6c 61 74 69 6e 67 20 74 | 68 65 20 6f 76 65 72 68 |lating t|he overh|
|00001b40| 65 61 64 20 72 65 71 75 | 69 72 65 64 20 62 79 20 |ead requ|ired by |
|00001b50| 74 68 65 0a 58 70 72 6f | 67 72 61 6d 2e 20 54 68 |the.Xpro|gram. Th|
|00001b60| 65 20 61 63 74 75 61 6c | 20 74 65 73 74 20 69 6e |e actual| test in|
|00001b70| 76 6f 6c 76 65 73 20 61 | 73 73 69 67 6e 6d 65 6e |volves a|ssignmen|
|00001b80| 74 2c 20 61 64 64 69 74 | 69 6f 6e 2c 20 73 75 62 |t, addit|ion, sub|
|00001b90| 74 72 61 63 74 69 6f 6e | 2c 0a 58 6d 75 6c 74 69 |traction|,.Xmulti|
|00001ba0| 70 6c 69 63 61 74 69 6f | 6e 2c 20 61 6e 64 20 64 |plicatio|n, and d|
|00001bb0| 69 76 69 73 69 6f 6e 2e | 20 56 65 72 79 20 73 69 |ivision.| Very si|
|00001bc0| 6d 70 6c 65 2e 20 42 75 | 74 20 64 6f 6e 27 74 20 |mple. Bu|t don't |
|00001bd0| 62 6f 74 68 65 72 20 72 | 75 6e 6e 69 6e 67 20 74 |bother r|unning t|
|00001be0| 68 65 20 66 6c 6f 61 74 | 0a 58 61 6e 64 20 64 6f |he float|.Xand do|
|00001bf0| 75 62 6c 65 20 70 72 65 | 63 69 73 69 6f 6e 20 74 |uble pre|cision t|
|00001c00| 65 73 74 20 75 6e 6c 65 | 73 73 20 79 6f 75 20 68 |est unle|ss you h|
|00001c10| 61 76 65 20 61 20 6d 61 | 74 68 20 63 6f 2d 70 72 |ave a ma|th co-pr|
|00001c20| 6f 63 65 73 73 6f 72 3b | 20 77 68 61 74 20 74 61 |ocessor;| what ta|
|00001c30| 6b 65 73 20 61 0a 58 6d | 61 74 68 20 63 6f 2d 70 |kes a.Xm|ath co-p|
|00001c40| 72 6f 63 65 73 73 6f 72 | 20 73 79 73 74 65 6d 20 |rocessor| system |
|00001c50| 31 35 20 73 65 63 6f 6e | 64 73 2c 20 6d 61 79 20 |15 secon|ds, may |
|00001c60| 74 61 6b 65 20 61 6e 20 | 75 6e 61 69 64 65 64 20 |take an |unaided |
|00001c70| 70 72 6f 63 65 73 73 6f | 72 20 33 30 20 6d 69 6e |processo|r 30 min|
|00001c80| 75 74 65 73 0a 58 6f 72 | 20 6d 6f 72 65 21 0a 58 |utes.Xor| more!.X|
|00001c90| 20 20 54 68 65 20 73 79 | 73 74 65 6d 20 63 61 6c | The sy|stem cal|
|00001ca0| 6c 20 74 65 73 74 73 20 | 61 72 65 3a 20 73 79 73 |l tests |are: sys|
|00001cb0| 74 65 6d 20 63 61 6c 6c | 20 6f 76 65 72 68 65 61 |tem call| overhea|
|00001cc0| 64 2c 20 70 69 70 65 20 | 74 68 72 6f 75 67 68 70 |d, pipe |throughp|
|00001cd0| 75 74 2c 20 70 69 70 65 | 0a 58 63 6f 6e 74 65 78 |ut, pipe|.Xcontex|
|00001ce0| 74 20 73 77 69 74 63 68 | 69 6e 67 2c 20 73 70 61 |t switch|ing, spa|
|00001cf0| 77 6e 69 6e 67 20 6f 66 | 20 63 68 69 6c 64 20 70 |wning of| child p|
|00001d00| 72 6f 63 65 73 73 65 73 | 2c 20 65 78 65 63 6c 20 |rocesses|, execl |
|00001d10| 28 72 65 70 6c 61 63 65 | 6d 65 6e 74 20 6f 66 20 |(replace|ment of |
|00001d20| 74 68 65 0a 58 63 75 72 | 72 65 6e 74 20 70 72 6f |the.Xcur|rent pro|
|00001d30| 63 65 73 73 20 62 79 20 | 61 20 6e 65 77 20 70 72 |cess by |a new pr|
|00001d40| 6f 63 65 73 73 29 2c 20 | 61 6e 64 20 66 69 6c 65 |ocess), |and file|
|00001d50| 20 72 65 61 64 2c 20 77 | 72 69 74 65 2c 20 61 6e | read, w|rite, an|
|00001d60| 64 20 63 6f 70 79 2e 20 | 54 68 65 20 73 79 73 74 |d copy. |The syst|
|00001d70| 65 6d 0a 58 63 61 6c 6c | 20 6f 76 65 72 68 65 61 |em.Xcall| overhea|
|00001d80| 64 20 74 65 73 74 20 65 | 76 61 6c 75 61 74 65 73 |d test e|valuates|
|00001d90| 20 74 68 65 20 74 69 6d | 65 20 72 65 71 75 69 72 | the tim|e requir|
|00001da0| 65 64 20 74 6f 20 64 6f | 20 69 74 65 72 61 74 69 |ed to do| iterati|
|00001db0| 6f 6e 73 20 6f 66 0a 58 | 21 4d 4f 4e 4f 21 64 75 |ons of.X|!MONO!du|
|00001dc0| 70 28 29 21 45 4e 44 4d | 4f 4e 4f 21 2c 20 21 4d |p()!ENDM|ONO!, !M|
|00001dd0| 4f 4e 4f 21 63 6c 6f 73 | 65 28 29 21 45 4e 44 4d |ONO!clos|e()!ENDM|
|00001de0| 4f 4e 4f 21 2c 20 21 4d | 4f 4e 4f 21 67 65 74 70 |ONO!, !M|ONO!getp|
|00001df0| 69 64 28 29 21 45 4e 44 | 4d 4f 4e 4f 21 2c 0a 58 |id()!END|MONO!,.X|
|00001e00| 21 4d 4f 4e 4f 21 67 65 | 74 75 69 64 28 29 21 45 |!MONO!ge|tuid()!E|
|00001e10| 4e 44 4d 4f 4e 4f 21 2c | 20 61 6e 64 20 21 4d 4f |NDMONO!,| and !MO|
|00001e20| 4e 4f 21 75 6d 61 73 6b | 28 29 21 45 4e 44 4d 4f |NO!umask|()!ENDMO|
|00001e30| 4e 4f 21 20 63 61 6c 6c | 73 2e 0a 58 20 20 54 68 |NO! call|s..X Th|
|00001e40| 65 20 70 69 70 65 20 74 | 68 72 6f 75 67 68 70 75 |e pipe t|hroughpu|
|00001e50| 74 20 74 65 73 74 20 68 | 61 73 20 6e 6f 20 72 65 |t test h|as no re|
|00001e60| 61 6c 20 63 6f 75 6e 74 | 65 72 70 61 72 74 20 69 |al count|erpart i|
|00001e70| 6e 20 72 65 61 6c 2d 77 | 6f 72 6c 64 20 70 72 6f |n real-w|orld pro|
|00001e80| 67 72 61 6d 6d 69 6e 67 | 3b 0a 58 69 6e 20 69 74 |gramming|;.Xin it|
|00001e90| 2c 20 61 20 73 69 6e 67 | 6c 65 20 70 72 6f 63 65 |, a sing|le proce|
|00001ea0| 73 73 20 6f 70 65 6e 73 | 20 61 20 70 69 70 65 20 |ss opens| a pipe |
|00001eb0| 28 61 6e 20 69 6e 74 65 | 72 2d 70 72 6f 63 65 73 |(an inte|r-proces|
|00001ec0| 73 20 63 6f 6d 6d 75 6e | 69 63 61 74 69 6f 6e 73 |s commun|ications|
|00001ed0| 20 63 68 61 6e 6e 65 6c | 0a 58 74 68 61 74 20 77 | channel|.Xthat w|
|00001ee0| 6f 72 6b 73 20 72 61 74 | 68 65 72 20 6c 69 6b 65 |orks rat|her like|
|00001ef0| 20 69 74 73 20 70 6c 75 | 6d 62 69 6e 67 20 6e 61 | its plu|mbing na|
|00001f00| 6d 65 73 61 6b 65 29 20 | 74 6f 20 69 74 73 65 6c |mesake) |to itsel|
|00001f10| 66 20 61 6e 64 20 73 70 | 69 6e 73 20 61 20 6d 65 |f and sp|ins a me|
|00001f20| 67 61 62 79 74 65 0a 58 | 61 72 6f 75 6e 64 20 74 |gabyte.X|around t|
|00001f30| 68 69 73 20 73 68 6f 72 | 74 20 6c 6f 6f 70 2e 20 |his shor|t loop. |
|00001f40| 59 6f 75 20 6d 69 67 68 | 74 20 63 61 6c 6c 20 74 |You migh|t call t|
|00001f50| 68 69 73 20 74 68 65 20 | 70 69 70 65 20 6f 76 65 |his the |pipe ove|
|00001f60| 72 68 65 61 64 20 74 65 | 73 74 2e 20 54 68 65 0a |rhead te|st. The.|
|00001f70| 58 63 6f 6e 74 65 78 74 | 20 73 77 69 74 63 68 69 |Xcontext| switchi|
|00001f80| 6e 67 20 70 69 70 65 20 | 74 65 73 74 20 69 73 20 |ng pipe |test is |
|00001f90| 6d 6f 72 65 20 6c 69 6b | 65 20 61 20 72 65 61 6c |more lik|e a real|
|00001fa0| 2d 77 6f 72 6c 64 20 61 | 70 70 6c 69 63 61 74 69 |-world a|pplicati|
|00001fb0| 6f 6e 3b 20 74 68 65 20 | 74 65 73 74 0a 58 70 72 |on; the |test.Xpr|
|00001fc0| 6f 67 72 61 6d 20 73 70 | 61 77 6e 73 20 61 20 63 |ogram sp|awns a c|
|00001fd0| 68 69 6c 64 20 70 72 6f | 63 65 73 73 20 77 69 74 |hild pro|cess wit|
|00001fe0| 68 20 77 68 69 63 68 20 | 69 74 20 63 61 72 72 69 |h which |it carri|
|00001ff0| 65 73 20 6f 6e 20 61 20 | 62 69 2d 64 69 72 65 63 |es on a |bi-direc|
|00002000| 74 69 6f 6e 61 6c 20 70 | 69 70 65 0a 58 63 6f 6e |tional p|ipe.Xcon|
|00002010| 76 65 72 73 61 74 69 6f | 6e 2e 0a 58 20 20 54 68 |versatio|n..X Th|
|00002020| 65 20 73 70 61 77 6e 20 | 74 65 73 74 20 63 72 65 |e spawn |test cre|
|00002030| 61 74 65 73 20 61 20 63 | 68 69 6c 64 20 70 72 6f |ates a c|hild pro|
|00002040| 63 65 73 73 20 77 68 69 | 63 68 20 69 6d 6d 65 64 |cess whi|ch immed|
|00002050| 69 61 74 65 6c 79 20 64 | 69 65 73 20 61 66 74 65 |iately d|ies afte|
|00002060| 72 20 69 74 73 20 6f 77 | 6e 0a 58 21 4d 4f 4e 4f |r its ow|n.X!MONO|
|00002070| 21 66 6f 72 6b 28 29 21 | 45 4e 44 4d 4f 4e 4f 21 |!fork()!|ENDMONO!|
|00002080| 2e 20 54 68 65 20 70 72 | 6f 63 65 73 73 20 69 73 |. The pr|ocess is|
|00002090| 20 72 65 70 65 61 74 65 | 64 20 6f 76 65 72 20 61 | repeate|d over a|
|000020a0| 6e 64 20 6f 76 65 72 2e | 20 53 69 6d 69 6c 61 72 |nd over.| Similar|
|000020b0| 6c 79 2c 20 74 68 65 0a | 58 65 78 65 63 20 74 65 |ly, the.|Xexec te|
|000020c0| 73 74 20 69 73 20 61 20 | 70 72 6f 63 65 73 73 20 |st is a |process |
|000020d0| 74 68 61 74 20 72 65 70 | 65 61 74 65 64 6c 79 20 |that rep|eatedly |
|000020e0| 63 68 61 6e 67 65 73 20 | 74 6f 20 61 20 6e 65 77 |changes |to a new|
|000020f0| 20 69 6e 63 61 72 6e 61 | 74 69 6f 6e 2e 20 4f 6e | incarna|tion. On|
|00002100| 65 20 6f 66 0a 58 74 68 | 65 20 61 72 67 75 6d 65 |e of.Xth|e argume|
|00002110| 6e 74 73 20 70 61 73 73 | 65 64 20 74 6f 20 74 68 |nts pass|ed to th|
|00002120| 65 20 6e 65 77 20 69 6e | 63 61 72 6e 61 74 69 6f |e new in|carnatio|
|00002130| 6e 20 69 73 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |n is the| number |
|00002140| 6f 66 20 72 65 6d 61 69 | 6e 69 6e 67 0a 58 69 74 |of remai|ning.Xit|
|00002150| 65 72 61 74 69 6f 6e 73 | 20 28 74 68 65 72 65 20 |erations| (there |
|00002160| 68 61 73 20 74 6f 20 62 | 65 20 73 6f 6d 65 20 63 |has to b|e some c|
|00002170| 6f 6e 74 72 6f 6c 2c 20 | 61 66 74 65 72 20 61 6c |ontrol, |after al|
|00002180| 6c 29 2e 0a 58 20 54 68 | 65 20 66 69 6c 65 20 72 |l)..X Th|e file r|
|00002190| 65 61 64 2c 20 77 72 69 | 74 65 2c 20 61 6e 64 20 |ead, wri|te, and |
|000021a0| 63 6f 70 79 20 74 65 73 | 74 73 20 63 61 70 74 75 |copy tes|ts captu|
|000021b0| 72 65 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |re the n|umber of|
|000021c0| 20 63 68 61 72 61 63 74 | 65 72 73 20 74 68 61 74 | charact|ers that|
|000021d0| 0a 58 63 61 6e 20 62 65 | 20 77 72 69 74 74 65 6e |.Xcan be| written|
|000021e0| 2c 20 72 65 61 64 2c 20 | 61 6e 64 20 63 6f 70 69 |, read, |and copi|
|000021f0| 65 64 20 69 6e 20 61 20 | 73 70 65 63 69 66 69 65 |ed in a |specifie|
|00002200| 64 20 74 69 6d 65 20 28 | 64 65 66 61 75 6c 74 20 |d time (|default |
|00002210| 69 73 20 31 30 20 73 65 | 63 6f 6e 64 73 29 2e 0a |is 10 se|conds)..|
|00002220| 58 49 66 20 79 6f 75 20 | 72 75 6e 20 74 68 69 73 |XIf you |run this|
|00002230| 20 74 65 73 74 20 77 69 | 74 68 20 74 68 65 20 6d | test wi|th the m|
|00002240| 69 6e 69 6d 75 6d 20 65 | 6c 65 6d 65 6e 74 20 28 |inimum e|lement (|
|00002250| 31 20 73 65 63 6f 6e 64 | 29 2c 20 79 6f 75 20 73 |1 second|), you s|
|00002260| 68 6f 75 6c 64 20 73 65 | 65 20 61 0a 58 73 69 67 |hould se|e a.Xsig|
|00002270| 6e 69 66 69 63 61 6e 74 | 6c 79 20 68 69 67 68 65 |nificant|ly highe|
|00002280| 72 20 76 61 6c 75 65 20 | 66 6f 72 20 61 6c 6c 20 |r value |for all |
|00002290| 6f 70 65 72 61 74 69 6f | 6e 73 20 69 66 20 79 6f |operatio|ns if yo|
|000022a0| 75 72 20 73 79 73 74 65 | 6d 20 69 6d 70 6c 65 6d |ur syste|m implem|
|000022b0| 65 6e 74 73 20 64 69 73 | 6b 0a 58 63 61 63 68 65 |ents dis|k.Xcache|
|000022c0| 69 6e 67 2e 20 42 65 20 | 73 75 72 65 20 79 6f 75 |ing. Be |sure you|
|000022d0| 20 68 61 76 65 20 70 6c | 65 6e 74 79 20 6f 66 20 | have pl|enty of |
|000022e0| 64 69 73 6b 20 73 70 61 | 63 65 20 62 65 66 6f 72 |disk spa|ce befor|
|000022f0| 65 20 79 6f 75 20 72 75 | 6e 20 74 68 69 73 20 74 |e you ru|n this t|
|00002300| 65 73 74 2e 0a 58 0a 58 | 21 53 55 42 48 45 44 21 |est..X.X|!SUBHED!|
|00002310| 54 68 65 20 48 69 67 68 | 2d 4c 65 76 65 6c 20 42 |The High|-Level B|
|00002320| 65 6e 63 68 20 50 72 6f | 67 72 61 6d 73 21 45 4e |ench Pro|grams!EN|
|00002330| 44 53 55 42 48 45 44 21 | 0a 58 54 6f 20 71 75 61 |DSUBHED!|.XTo qua|
|00002340| 6c 69 66 79 20 61 73 20 | 61 20 68 69 67 68 2d 6c |lify as |a high-l|
|00002350| 65 76 65 6c 20 74 65 73 | 74 2c 20 74 68 65 20 74 |evel tes|t, the t|
|00002360| 65 73 74 20 6d 75 73 74 | 20 69 6e 76 6f 6c 76 65 |est must| involve|
|00002370| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 74 68 61 74 | operati|ons that|
|00002380| 20 61 0a 58 72 65 61 6c | 2d 77 6f 72 6c 64 20 61 | a.Xreal|-world a|
|00002390| 70 70 6c 69 63 61 74 69 | 6f 6e 20 70 72 6f 67 72 |pplicati|on progr|
|000023a0| 61 6d 20 6d 69 67 68 74 | 20 65 6d 70 6c 6f 79 2c |am might| employ,|
|000023b0| 20 69 6e 63 6c 75 64 69 | 6e 67 20 68 65 61 76 79 | includi|ng heavy|
|000023c0| 20 75 73 65 20 6f 66 20 | 74 68 65 20 43 50 55 0a | use of |the CPU.|
|000023d0| 58 61 6e 64 20 64 69 73 | 6b 2e 20 41 74 20 74 68 |Xand dis|k. At th|
|000023e0| 65 20 74 69 6d 65 20 6f | 66 20 77 72 69 74 69 6e |e time o|f writin|
|000023f0| 67 20 74 68 69 73 20 61 | 72 74 69 63 6c 65 2c 20 |g this a|rticle, |
|00002400| 77 65 20 68 61 76 65 20 | 63 75 72 72 65 6e 74 6c |we have |currentl|
|00002410| 79 20 69 6d 70 6c 65 6d | 65 6e 74 65 64 0a 58 6f |y implem|ented.Xo|
|00002420| 6e 6c 79 20 74 68 65 20 | 73 79 73 74 65 6d 20 6c |nly the |system l|
|00002430| 6f 61 64 69 6e 67 20 61 | 6e 64 20 64 61 74 61 62 |oading a|nd datab|
|00002440| 61 73 65 20 74 65 73 74 | 73 2c 20 62 75 74 20 77 |ase test|s, but w|
|00002450| 65 20 77 69 6c 6c 20 62 | 65 20 61 64 64 69 6e 67 |e will b|e adding|
|00002460| 20 73 65 76 65 72 61 6c | 20 6e 65 77 0a 58 74 65 | several| new.Xte|
|00002470| 73 74 73 20 69 6e 20 74 | 68 65 20 6d 6f 6e 74 68 |sts in t|he month|
|00002480| 73 20 61 68 65 61 64 2e | 0a 58 20 20 54 68 65 20 |s ahead.|.X The |
|00002490| 73 79 73 74 65 6d 20 6c | 6f 61 64 69 6e 67 20 74 |system l|oading t|
|000024a0| 65 73 74 20 69 73 20 61 | 20 73 68 65 6c 6c 20 73 |est is a| shell s|
|000024b0| 63 72 69 70 74 20 74 68 | 61 74 20 69 73 20 72 75 |cript th|at is ru|
|000024c0| 6e 20 62 79 20 31 2c 20 | 32 2c 20 34 2c 20 61 6e |n by 1, |2, 4, an|
|000024d0| 64 20 38 0a 58 63 6f 6e | 63 75 72 72 65 6e 74 20 |d 8.Xcon|current |
|000024e0| 70 72 6f 63 65 73 73 65 | 73 2e 20 54 68 65 20 73 |processe|s. The s|
|000024f0| 63 72 69 70 74 20 63 6f | 6e 73 69 73 74 73 20 6f |cript co|nsists o|
|00002500| 66 20 61 6e 20 61 6c 70 | 68 61 62 65 74 69 63 20 |f an alp|habetic |
|00002510| 73 6f 72 74 20 6f 6e 65 | 20 66 69 6c 65 20 74 6f |sort one| file to|
|00002520| 0a 58 61 6e 6f 74 68 65 | 72 3b 20 74 61 6b 69 6e |.Xanothe|r; takin|
|00002530| 67 20 74 68 65 20 6f 63 | 74 61 6c 20 64 75 6d 70 |g the oc|tal dump|
|00002540| 20 6f 66 20 74 68 65 20 | 72 65 73 75 6c 74 20 61 | of the |result a|
|00002550| 6e 64 20 64 6f 69 6e 67 | 20 61 20 6e 75 6d 65 72 |nd doing| a numer|
|00002560| 69 63 20 73 6f 72 74 20 | 74 6f 20 61 0a 58 74 68 |ic sort |to a.Xth|
|00002570| 69 72 64 20 66 69 6c 65 | 3b 20 72 75 6e 6e 69 6e |ird file|; runnin|
|00002580| 67 20 67 72 65 70 20 6f | 6e 20 74 68 65 20 72 65 |g grep o|n the re|
|00002590| 73 75 6c 74 20 6f 66 20 | 74 68 65 20 61 6c 70 68 |sult of |the alph|
|000025a0| 61 62 65 74 69 63 20 73 | 6f 72 74 20 66 69 6c 65 |abetic s|ort file|
|000025b0| 3b 0a 58 21 4d 4f 4e 4f | 21 74 65 65 21 45 4e 44 |;.X!MONO|!tee!END|
|000025c0| 4d 4f 4e 4f 21 69 6e 67 | 20 74 68 65 20 72 65 73 |MONO!ing| the res|
|000025d0| 75 6c 74 20 74 6f 20 61 | 20 66 69 6c 65 20 61 6e |ult to a| file an|
|000025e0| 64 20 74 6f 20 21 4d 4f | 4e 4f 21 77 63 21 45 4e |d to !MO|NO!wc!EN|
|000025f0| 44 4d 4f 4e 4f 21 20 28 | 77 6f 72 64 0a 58 63 6f |DMONO! (|word.Xco|
|00002600| 75 6e 74 29 3b 20 77 72 | 69 74 69 6e 67 20 74 68 |unt); wr|iting th|
|00002610| 65 20 66 69 6e 61 6c 20 | 72 65 73 75 6c 74 20 74 |e final |result t|
|00002620| 6f 20 61 20 66 69 6c 65 | 3b 20 61 6e 64 20 72 65 |o a file|; and re|
|00002630| 6d 6f 76 69 6e 67 20 61 | 6c 6c 20 6f 66 20 74 68 |moving a|ll of th|
|00002640| 65 20 72 65 73 75 6c 74 | 69 6e 67 0a 58 66 69 6c |e result|ing.Xfil|
|00002650| 65 73 2e 20 54 68 69 73 | 20 73 63 72 69 70 74 20 |es. This| script |
|00002660| 77 61 73 20 75 73 65 64 | 20 69 6e 20 74 68 65 20 |was used| in the |
|00002670| 6f 72 69 67 69 6e 61 6c | 20 42 59 54 45 20 55 4e |original| BYTE UN|
|00002680| 49 58 20 62 65 6e 63 68 | 6d 61 72 6b 73 20 28 31 |IX bench|marks (1|
|00002690| 39 38 33 29 2c 20 62 75 | 74 0a 58 74 68 65 20 73 |983), bu|t.Xthe s|
|000026a0| 6f 75 72 63 65 20 66 69 | 6c 65 20 69 73 20 73 65 |ource fi|le is se|
|000026b0| 76 65 72 61 6c 20 6d 61 | 67 6e 69 74 75 64 65 73 |veral ma|gnitudes|
|000026c0| 20 6c 61 72 67 65 72 20 | 74 68 61 6e 20 74 68 65 | larger |than the|
|000026d0| 20 6f 72 69 67 69 6e 61 | 6c 2e 0a 58 20 20 54 68 | origina|l..X Th|
|000026e0| 65 20 43 20 63 6f 6d 70 | 69 6c 65 20 61 6e 64 20 |e C comp|ile and |
|000026f0| 6c 69 6e 6b 20 69 73 20 | 6e 6f 74 68 69 6e 67 20 |link is |nothing |
|00002700| 6d 6f 72 65 20 74 68 61 | 6e 20 74 68 61 74 2e 0a |more tha|n that..|
|00002710| 58 20 20 54 68 65 20 64 | 61 74 61 62 61 73 65 20 |X The d|atabase |
|00002720| 6f 70 65 72 61 74 69 6f | 6e 73 20 63 6f 6e 73 69 |operatio|ns consi|
|00002730| 73 74 20 6f 66 20 72 61 | 6e 64 6f 6d 20 72 65 61 |st of ra|ndom rea|
|00002740| 64 2c 20 77 72 69 74 65 | 2c 20 61 6e 64 20 61 64 |d, write|, and ad|
|00002750| 64 20 6f 70 65 72 61 74 | 69 6f 6e 73 0a 58 6f 6e |d operat|ions.Xon|
|00002760| 20 61 20 64 61 74 61 62 | 61 73 65 20 66 69 6c 65 | a datab|ase file|
|00002770| 2e 20 54 68 65 20 6f 70 | 65 72 61 74 69 6f 6e 73 |. The op|erations|
|00002780| 20 61 72 65 20 68 61 6e | 64 6c 65 64 20 62 79 20 | are han|dled by |
|00002790| 61 20 73 65 72 76 65 72 | 20 70 72 6f 63 65 73 73 |a server| process|
|000027a0| 3b 20 74 68 65 0a 58 72 | 65 71 75 65 73 74 73 20 |; the.Xr|equests |
|000027b0| 63 6f 6d 65 20 66 72 6f | 6d 20 63 6c 69 65 6e 74 |come fro|m client|
|000027c0| 20 70 72 6f 63 65 73 73 | 65 73 2e 20 54 68 65 20 | process|es. The |
|000027d0| 74 65 73 74 20 69 73 20 | 72 75 6e 20 77 69 74 68 |test is |run with|
|000027e0| 20 31 2c 20 32 2c 20 34 | 2c 20 61 6e 64 20 38 0a | 1, 2, 4|, and 8.|
|000027f0| 58 63 6c 69 65 6e 74 20 | 70 72 6f 63 65 73 73 65 |Xclient |processe|
|00002800| 73 2e 20 54 68 65 20 74 | 65 73 74 20 65 6d 70 6c |s. The t|est empl|
|00002810| 6f 79 73 20 73 65 6d 61 | 70 68 6f 72 65 73 20 61 |oys sema|phores a|
|00002820| 6e 64 20 6d 65 73 73 61 | 67 65 20 71 75 65 75 65 |nd messa|ge queue|
|00002830| 73 2e 20 53 65 6d 61 70 | 68 6f 72 65 73 0a 58 61 |s. Semap|hores.Xa|
|00002840| 72 65 20 62 65 69 6e 67 | 20 75 73 65 64 20 6c 65 |re being| used le|
|00002850| 73 73 20 61 6e 64 20 6c | 65 73 73 20 74 68 65 73 |ss and l|ess thes|
|00002860| 65 20 64 61 79 73 2e 20 | 42 53 44 20 73 79 73 74 |e days. |BSD syst|
|00002870| 65 6d 73 20 75 73 65 20 | 73 6f 63 6b 65 74 73 20 |ems use |sockets |
|00002880| 69 6e 73 74 65 61 64 20 | 69 6e 0a 58 70 6c 61 63 |instead |in.Xplac|
|00002890| 65 20 6f 66 20 62 6f 74 | 68 20 6f 66 20 74 68 65 |e of bot|h of the|
|000028a0| 73 65 20 53 79 73 74 65 | 6d 20 56 2e 33 20 49 50 |se Syste|m V.3 IP|
|000028b0| 43 20 75 74 69 6c 69 74 | 69 65 73 2e 20 53 79 73 |C utilit|ies. Sys|
|000028c0| 74 65 6d 20 56 2e 34 20 | 6f 66 66 65 72 73 20 62 |tem V.4 |offers b|
|000028d0| 6f 74 68 2e 20 54 68 69 | 73 0a 58 74 65 73 74 20 |oth. Thi|s.Xtest |
|000028e0| 69 73 20 62 65 69 6e 67 | 20 72 65 77 72 69 74 74 |is being| rewritt|
|000028f0| 65 6e 20 75 73 69 6e 67 | 20 73 6f 63 6b 65 74 73 |en using| sockets|
|00002900| 2c 20 62 75 74 20 73 69 | 6e 63 65 20 58 65 6e 69 |, but si|nce Xeni|
|00002910| 78 20 64 6f 65 73 6e 27 | 74 20 69 6d 70 6c 65 6d |x doesn'|t implem|
|00002920| 65 6e 74 0a 58 73 6f 63 | 6b 65 74 73 2c 20 6f 75 |ent.Xsoc|kets, ou|
|00002930| 72 20 62 61 73 65 6c 69 | 6e 65 20 63 6f 6e 66 69 |r baseli|ne confi|
|00002940| 67 75 72 61 74 69 6f 6e | 20 62 65 63 6f 6d 65 73 |guration| becomes|
|00002950| 20 69 6e 73 74 61 6e 74 | 6c 79 20 6f 62 73 6f 6c | instant|ly obsol|
|00002960| 65 74 65 20 77 68 65 6e | 20 77 65 0a 58 72 65 70 |ete when| we.Xrep|
|00002970| 6c 61 63 65 20 74 68 65 | 20 64 61 74 61 62 61 73 |lace the| databas|
|00002980| 65 20 74 65 73 74 2e 20 | 4a 75 73 74 20 61 6e 6f |e test. |Just ano|
|00002990| 74 68 65 72 20 6f 6e 65 | 20 6f 66 20 74 68 6f 73 |ther one| of thos|
|000029a0| 65 20 6c 69 74 74 6c 65 | 20 70 72 6f 62 6c 65 6d |e little| problem|
|000029b0| 73 20 69 6e 0a 58 74 72 | 79 69 6e 67 20 74 6f 20 |s in.Xtr|ying to |
|000029c0| 63 72 65 61 74 65 20 6a | 6f 75 72 6e 61 6c 69 73 |create j|ournalis|
|000029d0| 74 69 63 20 63 6f 6d 70 | 75 74 65 72 20 62 65 6e |tic comp|uter ben|
|000029e0| 63 68 6d 61 72 6b 73 3a | 20 61 6e 79 20 70 72 6f |chmarks:| any pro|
|000029f0| 67 72 61 6d 20 74 68 61 | 74 20 68 61 73 20 62 65 |gram tha|t has be|
|00002a00| 65 6e 0a 58 66 75 6c 6c | 79 20 64 65 62 75 67 67 |en.Xfull|y debugg|
|00002a10| 65 64 20 69 73 20 70 72 | 6f 62 61 62 6c 79 20 6f |ed is pr|obably o|
|00002a20| 62 73 6f 6c 65 74 65 20 | 5b 20 4d 75 72 70 68 79 |bsolete |[ Murphy|
|00002a30| 2c 20 65 74 20 61 6c 20 | 5d 2e 0a 58 0a 58 21 53 |, et al |]..X.X!S|
|00002a40| 55 42 48 45 44 21 4d 69 | 73 63 65 6c 6c 61 6e 79 |UBHED!Mi|scellany|
|00002a50| 21 45 4e 44 53 55 42 48 | 45 44 21 0a 58 54 68 65 |!ENDSUBH|ED!.XThe|
|00002a60| 20 72 65 6d 61 69 6e 69 | 6e 67 20 74 65 73 74 73 | remaini|ng tests|
|00002a70| 20 61 72 65 20 69 6e 20 | 74 68 65 20 6d 69 73 63 | are in |the misc|
|00002a80| 65 6c 6c 61 6e 65 6f 75 | 73 20 67 72 6f 75 70 3a |ellaneou|s group:|
|00002a90| 20 54 6f 77 65 72 20 6f | 66 20 48 61 6e 6f 69 20 | Tower o|f Hanoi |
|00002aa0| 28 61 20 74 65 73 74 20 | 6f 66 0a 58 72 65 63 75 |(a test |of.Xrecu|
|00002ab0| 72 73 69 76 65 20 6f 70 | 65 72 61 74 69 6f 6e 73 |rsive op|erations|
|00002ac0| 29 20 61 6e 64 20 61 20 | 74 65 73 74 20 6f 66 20 |) and a |test of |
|00002ad0| 74 68 65 20 55 4e 49 58 | 20 61 72 62 69 74 72 61 |the UNIX| arbitra|
|00002ae0| 72 79 20 70 72 65 63 69 | 73 69 6f 6e 20 63 61 6c |ry preci|sion cal|
|00002af0| 63 75 6c 61 74 6f 72 0a | 58 63 61 6c 63 75 6c 61 |culator.|Xcalcula|
|00002b00| 74 69 6e 67 20 74 68 65 | 20 73 71 75 61 72 65 20 |ting the| square |
|00002b10| 72 6f 6f 74 20 6f 66 20 | 74 77 6f 20 74 6f 20 39 |root of |two to 9|
|00002b20| 39 20 64 65 63 69 6d 61 | 6c 20 70 6c 61 63 65 73 |9 decima|l places|
|00002b30| 2e 0a 58 20 20 4e 6f 20 | 64 6f 75 62 74 2c 20 77 |..X No |doubt, w|
|00002b40| 65 20 77 69 6c 6c 20 62 | 65 20 61 64 64 69 6e 67 |e will b|e adding|
|00002b50| 20 74 65 73 74 73 20 74 | 6f 20 74 68 69 73 20 73 | tests t|o this s|
|00002b60| 75 69 74 65 20 61 73 20 | 77 65 20 73 65 65 20 74 |uite as |we see t|
|00002b70| 68 65 20 6e 65 65 64 20 | 74 6f 20 74 65 73 74 0a |he need |to test.|
|00002b80| 58 61 6e 64 20 65 76 61 | 6c 75 61 74 65 20 66 72 |Xand eva|luate fr|
|00002b90| 6f 6d 20 64 69 66 66 65 | 72 65 6e 74 20 70 65 72 |om diffe|rent per|
|00002ba0| 73 70 65 63 74 69 76 65 | 73 2e 0a 58 0a 58 21 53 |spective|s..X.X!S|
|00002bb0| 55 42 48 45 44 21 50 72 | 6f 62 6c 65 6d 73 20 69 |UBHED!Pr|oblems i|
|00002bc0| 6e 20 74 68 65 20 4d 6f | 64 65 72 6e 20 57 6f 72 |n the Mo|dern Wor|
|00002bd0| 6c 64 21 45 4e 44 53 55 | 42 48 45 44 21 0a 58 54 |ld!ENDSU|BHED!.XT|
|00002be0| 68 65 20 6d 61 6a 6f 72 | 20 70 72 6f 62 6c 65 6d |he major| problem|
|00002bf0| 20 77 65 20 68 61 76 65 | 20 68 61 64 20 77 69 74 | we have| had wit|
|00002c00| 68 20 64 65 76 65 6c 6f | 70 69 6e 67 20 74 68 65 |h develo|ping the|
|00002c10| 20 55 4e 49 58 20 62 65 | 6e 63 68 6d 61 72 6b 20 | UNIX be|nchmark |
|00002c20| 70 72 6f 67 72 61 6d 73 | 20 69 73 0a 58 64 65 73 |programs| is.Xdes|
|00002c30| 69 67 6e 69 6e 67 20 74 | 68 65 6d 20 73 6f 20 74 |igning t|hem so t|
|00002c40| 68 61 74 20 74 68 65 79 | 20 66 61 69 72 6c 79 20 |hat they| fairly |
|00002c50| 72 65 66 6c 65 63 74 20 | 74 68 65 20 73 74 72 65 |reflect |the stre|
|00002c60| 6e 67 74 68 73 20 61 6e | 64 20 77 65 61 6b 6e 65 |ngths an|d weakne|
|00002c70| 73 73 65 73 20 6f 66 0a | 58 61 6c 6c 20 74 68 65 |sses of.|Xall the|
|00002c80| 20 73 79 73 74 65 6d 73 | 20 6f 6e 20 77 68 69 63 | systems| on whic|
|00002c90| 68 20 77 65 20 61 6e 74 | 69 63 69 70 61 74 65 20 |h we ant|icipate |
|00002ca0| 75 73 69 6e 67 20 74 68 | 65 6d 2e 20 46 6f 72 20 |using th|em. For |
|00002cb0| 65 78 61 6d 70 6c 65 2c | 20 74 68 65 0a 58 6f 70 |example,| the.Xop|
|00002cc0| 65 72 61 74 69 6f 6e 73 | 20 73 68 6f 75 6c 64 20 |erations| should |
|00002cd0| 61 6c 6c 6f 77 20 52 49 | 53 43 20 6d 61 63 68 69 |allow RI|SC machi|
|00002ce0| 6e 65 73 20 74 6f 20 67 | 69 76 65 20 61 70 70 72 |nes to g|ive appr|
|00002cf0| 6f 70 72 69 61 74 65 6c | 79 20 68 69 67 68 20 70 |opriatel|y high p|
|00002d00| 65 72 66 6f 72 6d 61 6e | 63 65 0a 58 66 6f 72 20 |erforman|ce.Xfor |
|00002d10| 74 68 65 20 73 6f 72 74 | 73 20 6f 66 20 6f 70 65 |the sort|s of ope|
|00002d20| 72 61 74 69 6f 6e 73 20 | 74 68 61 74 20 52 49 53 |rations |that RIS|
|00002d30| 43 20 69 73 20 67 6f 6f | 64 20 66 6f 72 2c 20 61 |C is goo|d for, a|
|00002d40| 6e 64 20 73 68 6f 75 6c | 64 20 61 6c 73 6f 20 69 |nd shoul|d also i|
|00002d50| 6c 6c 75 73 74 72 61 74 | 65 0a 58 69 6d 70 72 6f |llustrat|e.Ximpro|
|00002d60| 76 65 6d 65 6e 74 73 20 | 70 72 6f 76 69 64 65 64 |vements |provided|
|00002d70| 20 62 79 20 66 61 73 74 | 65 72 20 62 75 73 20 73 | by fast|er bus s|
|00002d80| 70 65 65 64 73 2c 20 62 | 65 74 74 65 72 20 6d 61 |peeds, b|etter ma|
|00002d90| 74 68 20 63 6f 70 72 6f | 63 65 73 73 6f 72 73 20 |th copro|cessors |
|00002da0| 61 6e 64 20 74 68 65 0a | 58 6c 69 6b 65 2e 20 49 |and the.|Xlike. I|
|00002db0| 6e 20 74 68 65 20 63 61 | 73 65 20 6f 66 20 52 49 |n the ca|se of RI|
|00002dc0| 53 43 2c 20 74 68 65 20 | 65 66 66 69 63 69 65 6e |SC, the |efficien|
|00002dd0| 63 79 20 6f 66 20 74 68 | 65 20 63 6f 6d 70 69 6c |cy of th|e compil|
|00002de0| 65 72 20 69 73 20 6f 66 | 20 75 74 6d 6f 73 74 0a |er is of| utmost.|
|00002df0| 58 69 6d 70 6f 72 74 61 | 6e 63 65 3b 20 52 49 53 |Ximporta|nce; RIS|
|00002e00| 43 20 63 6f 6d 70 69 6c | 65 72 73 20 6d 75 73 74 |C compil|ers must|
|00002e10| 20 72 65 61 72 72 61 6e | 67 65 20 69 6e 73 74 72 | rearran|ge instr|
|00002e20| 75 63 74 69 6f 6e 73 20 | 74 6f 20 74 61 6b 65 20 |uctions |to take |
|00002e30| 61 64 76 61 6e 74 61 67 | 65 20 6f 66 0a 58 69 6e |advantag|e of.Xin|
|00002e40| 73 74 72 75 63 74 69 6f | 6e 20 70 69 70 65 6c 69 |structio|n pipeli|
|00002e50| 6e 69 6e 67 20 28 66 6f | 72 20 61 6e 20 6f 76 65 |ning (fo|r an ove|
|00002e60| 72 76 69 65 77 20 6f 66 | 20 52 49 53 43 2c 20 73 |rview of| RISC, s|
|00002e70| 65 65 20 42 59 54 45 2c | 20 4d 61 79 20 31 39 38 |ee BYTE,| May 198|
|00002e80| 38 29 2e 0a 58 20 20 54 | 68 65 20 6d 61 6a 6f 72 |8)..X T|he major|
|00002e90| 69 74 79 20 6f 66 20 74 | 68 65 20 55 4e 49 58 20 |ity of t|he UNIX |
|00002ea0| 73 79 73 74 65 6d 73 20 | 74 68 61 74 20 77 65 20 |systems |that we |
|00002eb0| 6c 6f 6f 6b 20 61 74 20 | 65 6d 70 6c 6f 79 20 64 |look at |employ d|
|00002ec0| 69 73 6b 20 63 61 63 68 | 69 6e 67 2e 20 54 68 69 |isk cach|ing. Thi|
|00002ed0| 73 0a 58 69 73 20 65 73 | 70 65 63 69 61 6c 6c 79 |s.Xis es|pecially|
|00002ee0| 20 69 6d 70 6f 72 74 61 | 6e 74 20 62 65 63 61 75 | importa|nt becau|
|00002ef0| 73 65 20 6d 6f 64 65 72 | 6e 20 55 4e 49 58 20 69 |se moder|n UNIX i|
|00002f00| 6e 63 6c 75 64 65 73 20 | 73 77 61 70 70 69 6e 67 |ncludes |swapping|
|00002f10| 20 61 6e 64 20 70 61 67 | 69 6e 67 20 6f 75 74 0a | and pag|ing out.|
|00002f20| 58 74 6f 20 64 69 73 6b | 20 77 68 65 6e 20 74 68 |Xto disk| when th|
|00002f30| 65 72 65 20 69 73 20 69 | 6e 73 75 66 66 69 63 69 |ere is i|nsuffici|
|00002f40| 65 6e 74 20 6d 65 6d 6f | 72 79 20 66 6f 72 20 61 |ent memo|ry for a|
|00002f50| 20 74 61 73 6b 20 6f 72 | 20 74 68 65 20 6e 75 6d | task or| the num|
|00002f60| 62 65 72 20 6f 66 20 74 | 61 73 6b 73 2e 0a 58 49 |ber of t|asks..XI|
|00002f70| 74 20 69 73 20 61 6e 20 | 69 6e 74 65 72 65 73 74 |t is an |interest|
|00002f80| 69 6e 67 20 65 78 65 72 | 63 69 73 65 20 74 6f 20 |ing exer|cise to |
|00002f90| 72 75 6e 20 74 68 65 20 | 64 69 73 6b 20 66 69 6c |run the |disk fil|
|00002fa0| 65 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 74 65 73 |e operat|ions tes|
|00002fb0| 74 20 77 69 74 68 0a 58 | 69 6e 63 72 65 61 73 69 |t with.X|increasi|
|00002fc0| 6e 67 6c 79 20 6c 61 72 | 67 65 20 66 69 6c 65 73 |ngly lar|ge files|
|00002fd0| 20 61 6e 64 20 6e 6f 74 | 65 20 74 68 65 20 70 6f | and not|e the po|
|00002fe0| 69 6e 74 20 61 74 20 77 | 68 69 63 68 20 70 65 72 |int at w|hich per|
|00002ff0| 66 6f 72 6d 61 6e 63 65 | 20 64 72 6f 70 73 2e 0a |formance| drops..|
|00003000| 58 0a 58 21 53 55 42 48 | 45 44 21 48 6f 77 20 54 |X.X!SUBH|ED!How T|
|00003010| 68 65 79 20 57 6f 72 6b | 21 45 4e 44 53 55 42 48 |hey Work|!ENDSUBH|
|00003020| 45 44 21 0a 58 41 20 34 | 30 30 20 6c 69 6e 65 20 |ED!.XA 4|00 line |
|00003030| 42 6f 75 72 6e 65 20 73 | 68 65 6c 6c 20 73 63 72 |Bourne s|hell scr|
|00003040| 69 70 74 20 28 21 4d 4f | 4e 4f 21 52 75 6e 21 45 |ipt (!MO|NO!Run!E|
|00003050| 4e 44 4d 4f 4e 4f 21 29 | 20 61 64 6d 69 6e 69 73 |NDMONO!)| adminis|
|00003060| 74 65 72 73 20 74 68 65 | 0a 58 62 65 6e 63 68 6d |ters the|.Xbenchm|
|00003070| 61 72 6b 69 6e 67 20 73 | 79 73 74 65 6d 2e 20 41 |arking s|ystem. A|
|00003080| 66 74 65 72 20 74 68 65 | 20 65 76 61 6c 75 61 74 |fter the| evaluat|
|00003090| 69 6f 6e 20 6f 66 20 74 | 68 65 20 63 6f 6d 6d 61 |ion of t|he comma|
|000030a0| 6e 64 20 6c 69 6e 65 20 | 6f 70 74 69 6f 6e 73 2c |nd line |options,|
|000030b0| 20 74 68 65 0a 58 62 65 | 6e 63 68 6d 61 72 6b 69 | the.Xbe|nchmarki|
|000030c0| 6e 67 20 6f 70 65 72 61 | 74 69 6f 6e 20 66 6f 72 |ng opera|tion for|
|000030d0| 20 65 61 63 68 20 74 65 | 73 74 20 68 61 73 20 74 | each te|st has t|
|000030e0| 68 72 65 65 20 73 74 61 | 67 65 73 3a 20 70 61 72 |hree sta|ges: par|
|000030f0| 61 6d 65 74 65 72 20 73 | 65 74 75 70 2c 0a 58 74 |ameter s|etup,.Xt|
|00003100| 69 6d 69 6e 67 20 74 68 | 65 20 65 78 65 63 75 74 |iming th|e execut|
|00003110| 69 6f 6e 20 6f 66 20 74 | 68 65 20 74 65 73 74 2c |ion of t|he test,|
|00003120| 20 61 6e 64 20 63 61 6c | 63 75 6c 61 74 69 6f 6e | and cal|culation|
|00003130| 2f 66 6f 72 6d 61 74 74 | 69 6e 67 20 6f 70 65 72 |/formatt|ing oper|
|00003140| 61 74 69 6f 6e 73 20 28 | 73 65 65 0a 58 46 69 67 |ations (|see.XFig|
|00003150| 75 72 65 20 31 29 2e 20 | 41 66 74 65 72 20 21 4d |ure 1). |After !M|
|00003160| 4f 4e 4f 21 52 75 6e 21 | 45 4e 44 4d 4f 4e 4f 21 |ONO!Run!|ENDMONO!|
|00003170| 20 64 65 74 65 72 6d 69 | 6e 65 73 20 74 68 65 20 | determi|nes the |
|00003180| 70 61 72 61 6d 65 74 65 | 72 73 20 66 6f 72 20 74 |paramete|rs for t|
|00003190| 68 65 20 74 65 73 74 2c | 0a 58 69 74 20 73 65 6e |he test,|.Xit sen|
|000031a0| 64 73 20 61 20 66 6f 72 | 6d 61 74 74 65 64 20 64 |ds a for|matted d|
|000031b0| 65 73 63 72 69 70 74 69 | 6f 6e 20 74 6f 20 74 68 |escripti|on to th|
|000031c0| 65 20 6f 75 74 70 75 74 | 20 66 69 6c 65 2e 20 21 |e output| file. !|
|000031d0| 4d 4f 4e 4f 21 52 75 6e | 21 45 4e 44 4d 4f 4e 4f |MONO!Run|!ENDMONO|
|000031e0| 21 20 74 68 65 6e 0a 58 | 69 6e 76 6f 6b 65 73 20 |! then.X|invokes |
|000031f0| 74 68 65 20 73 70 65 63 | 69 66 69 63 20 74 65 73 |the spec|ific tes|
|00003200| 74 20 62 79 20 6d 65 61 | 6e 73 20 6f 66 20 74 68 |t by mea|ns of th|
|00003210| 65 20 55 4e 49 58 20 63 | 6f 6d 6d 61 6e 64 20 21 |e UNIX c|ommand !|
|00003220| 4d 4f 4e 4f 21 74 69 6d | 65 21 45 4e 44 4d 4f 4e |MONO!tim|e!ENDMON|
|00003230| 4f 21 2e 0a 58 54 68 65 | 20 6f 75 74 70 75 74 20 |O!..XThe| output |
|00003240| 6f 66 20 21 4d 4f 4e 4f | 21 74 69 6d 65 21 45 4e |of !MONO|!time!EN|
|00003250| 44 4d 4f 4e 4f 21 20 61 | 6e 64 20 61 6e 79 20 6f |DMONO! a|nd any o|
|00003260| 75 74 70 75 74 20 66 72 | 6f 6d 20 74 68 65 20 74 |utput fr|om the t|
|00003270| 65 73 74 20 69 74 73 65 | 6c 66 20 65 6e 64 20 75 |est itse|lf end u|
|00003280| 70 0a 58 69 6e 20 61 20 | 72 61 77 20 64 61 74 61 |p.Xin a |raw data|
|00003290| 20 66 69 6c 65 2e 20 4d | 6f 73 74 20 74 65 73 74 | file. M|ost test|
|000032a0| 73 20 61 72 65 20 72 75 | 6e 20 73 69 78 20 74 69 |s are ru|n six ti|
|000032b0| 6d 65 73 20 73 6f 20 74 | 68 61 74 20 61 6e 79 20 |mes so t|hat any |
|000032c0| 76 61 72 69 61 6e 63 65 | 20 63 61 6e 20 62 65 0a |variance| can be.|
|000032d0| 58 61 76 65 72 61 67 65 | 64 2e 20 4f 6e 20 63 6f |Xaverage|d. On co|
|000032e0| 6d 70 6c 65 74 69 6f 6e | 20 6f 66 20 61 20 73 65 |mpletion| of a se|
|000032f0| 74 20 6f 66 20 74 65 73 | 74 73 2c 20 21 4d 4f 4e |t of tes|ts, !MON|
|00003300| 4f 21 52 75 6e 21 45 4e | 44 4d 4f 4e 4f 21 20 69 |O!Run!EN|DMONO! i|
|00003310| 6e 76 6f 6b 65 73 20 61 | 0a 58 63 6c 65 61 6e 75 |nvokes a|.Xcleanu|
|00003320| 70 20 73 63 72 69 70 74 | 2c 20 77 68 69 63 68 20 |p script|, which |
|00003330| 64 6f 65 73 20 74 68 65 | 20 73 74 61 74 69 73 74 |does the| statist|
|00003340| 69 63 61 6c 20 63 61 6c | 63 75 6c 61 74 69 6f 6e |ical cal|culation|
|00003350| 73 20 6f 6e 20 74 68 65 | 20 72 61 77 20 64 61 74 |s on the| raw dat|
|00003360| 61 20 75 73 69 6e 67 0a | 58 74 68 65 20 21 4d 4f |a using.|Xthe !MO|
|00003370| 4e 4f 21 61 77 6b 21 45 | 4e 44 4d 4f 4e 4f 21 20 |NO!awk!E|NDMONO! |
|00003380| 66 6f 72 6d 61 74 74 69 | 6e 67 20 6c 61 6e 67 75 |formatti|ng langu|
|00003390| 61 67 65 2e 0a 58 20 20 | 54 68 65 20 67 72 65 61 |age..X |The grea|
|000033a0| 74 65 72 20 70 61 72 74 | 20 6f 66 20 74 68 65 20 |ter part| of the |
|000033b0| 62 65 6e 63 68 6d 61 72 | 6b 20 70 72 6f 67 72 61 |benchmar|k progra|
|000033c0| 6d 73 20 61 72 65 20 77 | 72 69 74 74 65 6e 20 69 |ms are w|ritten i|
|000033d0| 6e 20 43 20 61 6e 64 20 | 61 72 65 0a 58 63 6f 6d |n C and |are.Xcom|
|000033e0| 70 69 6c 65 64 20 6f 6e | 20 74 68 65 20 74 65 73 |piled on| the tes|
|000033f0| 74 20 6d 61 63 68 69 6e | 65 20 70 72 69 6f 72 20 |t machin|e prior |
|00003400| 74 6f 20 72 75 6e 6e 69 | 6e 67 20 74 68 65 20 74 |to runni|ng the t|
|00003410| 65 73 74 73 2e 20 0a 58 | 0a 58 21 53 55 42 48 45 |ests. .X|.X!SUBHE|
|00003420| 44 21 55 73 69 6e 67 20 | 74 68 65 20 52 65 73 75 |D!Using |the Resu|
|00003430| 6c 74 73 21 45 4e 44 53 | 55 42 48 45 44 21 0a 58 |lts!ENDS|UBHED!.X|
|00003440| 49 66 20 61 6c 6c 20 79 | 6f 75 20 6e 65 65 64 20 |If all y|ou need |
|00003450| 69 73 20 61 20 72 61 77 | 20 6d 65 61 73 75 72 65 |is a raw| measure|
|00003460| 20 6f 66 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 2c | of perf|ormance,|
|00003470| 20 74 68 65 6e 20 66 65 | 65 6c 20 66 72 65 65 20 | then fe|el free |
|00003480| 74 6f 20 75 73 65 20 74 | 68 65 0a 58 44 68 72 79 |to use t|he.XDhry|
|00003490| 73 74 6f 6e 65 20 61 6e | 64 20 57 68 65 74 73 74 |stone an|d Whetst|
|000034a0| 6f 6e 65 20 74 65 73 74 | 73 20 61 73 20 69 6e 64 |one test|s as ind|
|000034b0| 69 63 65 73 20 6f 66 20 | 6a 75 73 74 20 74 68 61 |ices of |just tha|
|000034c0| 74 2e 20 42 75 74 20 69 | 66 20 79 6f 75 20 77 61 |t. But i|f you wa|
|000034d0| 6e 74 20 74 6f 20 75 73 | 65 0a 58 74 68 65 20 62 |nt to us|e.Xthe b|
|000034e0| 65 6e 63 68 6d 61 72 6b | 73 20 74 6f 20 65 76 61 |enchmark|s to eva|
|000034f0| 6c 75 61 74 65 20 61 20 | 6d 61 63 68 69 6e 65 27 |luate a |machine'|
|00003500| 73 20 61 62 69 6c 69 74 | 79 20 74 6f 20 73 65 72 |s abilit|y to ser|
|00003510| 76 65 20 73 6f 6d 65 20 | 72 65 61 6c 20 6e 65 65 |ve some |real nee|
|00003520| 64 2c 20 74 68 65 6e 0a | 58 79 6f 75 20 73 68 6f |d, then.|Xyou sho|
|00003530| 75 6c 64 20 64 6f 20 74 | 68 65 20 66 6f 6c 6c 6f |uld do t|he follo|
|00003540| 77 69 6e 67 3a 0a 58 31 | 2e 20 41 6e 61 6c 79 7a |wing:.X1|. Analyz|
|00003550| 65 20 79 6f 75 72 20 72 | 65 71 75 69 72 65 6d 65 |e your r|equireme|
|00003560| 6e 74 73 20 61 73 20 66 | 61 72 20 61 73 20 74 68 |nts as f|ar as th|
|00003570| 65 20 74 79 70 65 20 6f | 66 20 63 6f 6d 70 75 74 |e type o|f comput|
|00003580| 69 6e 67 2c 20 61 6d 6f | 75 6e 74 20 61 6e 64 20 |ing, amo|unt and |
|00003590| 74 79 70 65 0a 58 6f 66 | 20 63 6f 6d 6d 75 6e 69 |type.Xof| communi|
|000035a0| 63 61 74 69 6f 6e 73 20 | 49 2f 4f 2c 20 61 6e 64 |cations |I/O, and|
|000035b0| 20 61 6d 6f 75 6e 74 20 | 61 6e 64 20 74 79 70 65 | amount |and type|
|000035c0| 20 6f 66 20 64 69 73 6b | 20 49 2f 4f 2e 0a 58 32 | of disk| I/O..X2|
|000035d0| 2e 20 53 63 6f 72 65 20 | 74 68 65 20 73 75 62 6a |. Score |the subj|
|000035e0| 65 63 74 20 6d 61 63 68 | 69 6e 65 73 20 75 73 69 |ect mach|ines usi|
|000035f0| 6e 67 20 77 65 69 67 68 | 74 69 6e 67 20 66 61 63 |ng weigh|ting fac|
|00003600| 74 6f 72 73 20 74 68 61 | 74 20 72 65 66 6c 65 63 |tors tha|t reflec|
|00003610| 74 20 79 6f 75 72 0a 58 | 72 65 71 75 69 72 65 6d |t your.X|requirem|
|00003620| 65 6e 74 73 2e 0a 58 33 | 2e 20 47 65 6e 65 72 61 |ents..X3|. Genera|
|00003630| 74 65 20 61 20 70 72 69 | 63 65 20 76 73 2e 20 70 |te a pri|ce vs. p|
|00003640| 65 72 66 6f 72 6d 61 6e | 63 65 20 70 6c 6f 74 2e |erforman|ce plot.|
|00003650| 0a 58 34 2e 20 55 73 65 | 20 74 68 65 20 70 72 69 |.X4. Use| the pri|
|00003660| 63 65 20 76 73 2e 20 70 | 65 72 66 6f 72 6d 61 6e |ce vs. p|erforman|
|00003670| 63 65 2c 20 61 6c 6f 6e | 67 20 77 69 74 68 20 69 |ce, alon|g with i|
|00003680| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00003690| 20 74 68 65 0a 58 72 65 | 6c 69 61 62 69 6c 69 74 | the.Xre|liabilit|
|000036a0| 79 20 73 65 72 76 69 63 | 61 62 69 6c 69 74 79 20 |y servic|ability |
|000036b0| 6f 66 20 74 68 65 20 68 | 61 72 64 77 61 72 65 2e |of the h|ardware.|
|000036c0| 0a 58 20 20 53 74 65 70 | 20 34 20 69 73 20 72 65 |.X Step| 4 is re|
|000036d0| 61 6c 6c 79 20 6d 6f 72 | 65 20 6f 66 20 61 6e 20 |ally mor|e of an |
|000036e0| 61 72 74 20 74 68 61 6e | 20 61 6e 79 74 68 69 6e |art than| anythin|
|000036f0| 67 20 65 6c 73 65 2e 20 | 49 74 20 69 73 20 65 78 |g else. |It is ex|
|00003700| 74 72 65 6d 65 6c 79 0a | 58 69 6d 70 6f 72 74 61 |tremely.|Ximporta|
|00003710| 6e 74 2c 20 68 6f 77 65 | 76 65 72 2c 20 74 6f 20 |nt, howe|ver, to |
|00003720| 6e 6f 74 20 72 65 6c 79 | 20 6f 6e 20 70 72 69 63 |not rely| on pric|
|00003730| 65 20 76 73 2e 20 70 65 | 72 66 6f 72 6d 61 6e 63 |e vs. pe|rformanc|
|00003740| 65 20 61 6c 6f 6e 65 2e | 0a 58 20 57 65 20 75 73 |e alone.|.X We us|
|00003750| 65 20 6f 75 72 20 55 4e | 49 58 20 42 65 6e 63 68 |e our UN|IX Bench|
|00003760| 6d 61 72 6b 73 20 66 6f | 72 20 64 6f 69 6e 67 20 |marks fo|r doing |
|00003770| 61 20 72 6f 75 67 68 20 | 61 6e 61 6c 79 73 69 73 |a rough |analysis|
|00003780| 20 61 6e 64 20 63 6f 6d | 70 61 72 69 73 6f 6e 20 | and com|parison |
|00003790| 6f 66 0a 58 64 69 76 65 | 72 67 65 6e 74 20 6d 61 |of.Xdive|rgent ma|
|000037a0| 63 68 69 6e 65 73 2e 20 | 28 53 65 65 20 66 69 67 |chines. |(See fig|
|000037b0| 75 72 65 20 32 2c 20 60 | 60 55 4e 49 58 20 4d 61 |ure 2, `|`UNIX Ma|
|000037c0| 63 68 69 6e 65 73 20 54 | 65 73 74 65 64 2e 27 27 |chines T|ested.''|
|000037d0| 29 20 41 73 20 79 6f 75 | 20 63 61 6e 20 73 65 65 |) As you| can see|
|000037e0| 2c 0a 58 77 65 20 65 76 | 65 6e 20 67 6f 20 73 6f |,.Xwe ev|en go so|
|000037f0| 20 66 61 72 20 61 73 20 | 74 6f 20 67 65 6e 65 72 | far as |to gener|
|00003800| 61 74 65 20 61 20 73 69 | 6e 67 6c 65 20 69 6e 64 |ate a si|ngle ind|
|00003810| 65 78 20 6e 75 6d 62 65 | 72 2c 20 61 20 73 6f 72 |ex numbe|r, a sor|
|00003820| 74 20 6f 66 20 72 65 64 | 75 63 74 69 6f 6e 0a 58 |t of red|uction.X|
|00003830| 6f 66 20 61 6c 6c 20 6f | 66 20 74 68 65 20 62 65 |of all o|f the be|
|00003840| 6e 63 68 6d 61 72 6b 20 | 74 65 73 74 73 20 74 6f |nchmark |tests to|
|00003850| 20 61 20 73 69 6e 67 6c | 65 20 76 61 6c 75 65 2e | a singl|e value.|
|00003860| 20 54 68 69 73 20 69 6e | 64 65 78 20 69 73 20 67 | This in|dex is g|
|00003870| 65 6e 65 72 61 74 65 64 | 20 62 79 0a 58 73 75 6d |enerated| by.Xsum|
|00003880| 6d 69 6e 67 20 74 68 65 | 20 74 68 65 20 69 6e 64 |ming the| the ind|
|00003890| 69 76 69 64 75 61 6c 20 | 69 6e 64 69 63 65 73 20 |ividual |indices |
|000038a0| 6f 66 20 74 68 65 20 64 | 68 72 79 73 74 6f 6e 65 |of the d|hrystone|
|000038b0| 20 74 65 73 74 2c 20 74 | 68 65 20 66 6c 6f 61 74 | test, t|he float|
|000038c0| 69 6e 67 20 70 6f 69 6e | 74 0a 58 74 65 73 74 2c |ing poin|t.Xtest,|
|000038d0| 20 74 68 65 20 73 68 65 | 6c 6c 20 74 65 73 74 20 | the she|ll test |
|000038e0| 77 69 74 68 20 65 69 67 | 68 74 20 63 6f 6e 63 75 |with eig|ht concu|
|000038f0| 72 72 65 6e 74 20 70 72 | 6f 63 65 73 73 65 73 2c |rrent pr|ocesses,|
|00003900| 20 74 68 65 20 43 20 63 | 6f 6d 70 69 6c 65 72 20 | the C c|ompiler |
|00003910| 74 69 6d 65 2c 0a 58 74 | 68 65 20 21 4d 4f 4e 4f |time,.Xt|he !MONO|
|00003920| 21 64 63 21 45 4e 44 4d | 4f 4e 4f 21 20 72 6f 75 |!dc!ENDM|ONO! rou|
|00003930| 74 69 6e 65 2c 20 61 6e | 64 20 74 68 65 20 74 6f |tine, an|d the to|
|00003940| 77 65 72 20 6f 66 20 68 | 61 6e 6f 69 20 74 69 6d |wer of h|anoi tim|
|00003950| 65 2e 20 42 79 20 64 65 | 66 69 6e 69 74 69 6f 6e |e. By de|finition|
|00003960| 2c 0a 58 74 68 65 20 63 | 6f 6d 62 69 6e 65 64 20 |,.Xthe c|ombined |
|00003970| 69 6e 64 65 78 20 66 6f | 72 20 74 68 65 20 62 61 |index fo|r the ba|
|00003980| 73 65 6c 69 6e 65 20 6d | 61 63 68 69 6e 65 20 69 |seline m|achine i|
|00003990| 73 20 73 69 78 2e 20 49 | 6e 64 69 63 65 73 73 20 |s six. I|ndicess |
|000039a0| 61 62 6f 76 65 20 73 69 | 78 20 69 6d 70 6c 79 0a |above si|x imply.|
|000039b0| 58 61 20 62 65 74 74 65 | 72 20 6f 76 65 72 61 6c |Xa bette|r overal|
|000039c0| 6c 20 70 65 72 66 6f 72 | 6d 61 6e 63 65 20 74 68 |l perfor|mance th|
|000039d0| 61 6e 20 74 68 65 20 62 | 61 73 65 6c 69 6e 65 20 |an the b|aseline |
|000039e0| 6d 61 63 68 69 6e 65 3b | 20 69 6e 64 69 63 65 73 |machine;| indices|
|000039f0| 20 6c 65 73 73 20 74 68 | 61 6e 0a 58 73 69 78 2c | less th|an.Xsix,|
|00003a00| 20 77 6f 72 73 65 20 70 | 65 72 66 6f 72 6d 61 6e | worse p|erforman|
|00003a10| 63 65 2e 20 41 6c 77 61 | 79 73 20 6b 65 65 70 20 |ce. Alwa|ys keep |
|00003a20| 69 6e 20 6d 69 6e 64 20 | 74 68 61 74 20 68 61 76 |in mind |that hav|
|00003a30| 69 6e 67 20 61 20 73 69 | 6e 67 6c 65 20 69 6e 64 |ing a si|ngle ind|
|00003a40| 65 78 20 72 61 74 69 6e | 67 0a 58 66 6f 72 20 61 |ex ratin|g.Xfor a|
|00003a50| 20 6d 61 63 68 69 6e 65 | 20 6d 61 79 20 6d 61 6b | machine| may mak|
|00003a60| 65 20 67 6f 6f 64 20 63 | 6f 63 6b 74 61 69 6c 20 |e good c|ocktail |
|00003a70| 63 6f 6e 76 65 72 73 61 | 74 69 6f 6e 2c 20 62 75 |conversa|tion, bu|
|00003a80| 74 20 69 74 20 69 73 20 | 69 6e 63 72 65 64 69 62 |t it is |incredib|
|00003a90| 6c 79 0a 58 73 69 6d 70 | 6c 69 73 74 69 63 2e 20 |ly.Xsimp|listic. |
|00003aa0| 49 74 20 69 73 20 6c 69 | 6b 65 20 72 65 64 75 63 |It is li|ke reduc|
|00003ab0| 69 6e 67 20 61 20 63 6f | 6d 70 6c 65 78 20 73 63 |ing a co|mplex sc|
|00003ac0| 75 6c 70 74 75 72 61 6c | 20 73 68 61 70 65 20 74 |ulptural| shape t|
|00003ad0| 6f 20 61 20 73 69 6e 67 | 6c 65 20 70 6f 69 6e 74 |o a sing|le point|
|00003ae0| 3b 0a 58 79 6f 75 20 6e | 6f 20 6c 6f 6e 67 65 72 |;.Xyou n|o longer|
|00003af0| 20 63 61 6e 20 74 65 6c | 6c 20 77 68 61 74 20 79 | can tel|l what y|
|00003b00| 6f 75 20 61 72 65 20 6c | 6f 6f 6b 69 6e 67 20 61 |ou are l|ooking a|
|00003b10| 74 2e 20 54 68 69 73 20 | 6e 75 6d 62 65 72 20 64 |t. This |number d|
|00003b20| 6f 65 73 6e 27 74 20 72 | 65 66 6c 65 63 74 0a 58 |oesn't r|eflect.X|
|00003b30| 61 6e 79 20 72 65 61 6c | 2d 77 6f 72 6c 64 20 75 |any real|-world u|
|00003b40| 73 65 20 6f 66 20 61 20 | 55 4e 49 58 20 73 79 73 |se of a |UNIX sys|
|00003b50| 74 65 6d 2e 20 48 6f 77 | 65 76 65 72 2c 20 74 68 |tem. How|ever, th|
|00003b60| 65 20 69 6e 64 65 78 20 | 69 73 20 64 65 76 69 73 |e index |is devis|
|00003b70| 65 64 20 73 6f 20 74 68 | 61 74 20 69 74 0a 58 67 |ed so th|at it.Xg|
|00003b80| 69 76 65 73 20 61 6e 20 | 6f 76 65 72 61 6c 6c 20 |ives an |overall |
|00003b90| 69 6e 64 69 63 61 74 69 | 6f 6e 20 6f 66 20 64 69 |indicati|on of di|
|00003ba0| 66 66 65 72 65 6e 74 20 | 6b 69 6e 64 73 20 6f 66 |fferent |kinds of|
|00003bb0| 20 73 79 73 74 65 6d 20 | 6f 70 65 72 61 74 69 6f | system |operatio|
|00003bc0| 6e 73 20 61 6e 64 20 73 | 6f 20 69 73 0a 58 76 61 |ns and s|o is.Xva|
|00003bd0| 6c 75 61 62 6c 65 20 74 | 6f 20 6f 75 72 20 72 65 |luable t|o our re|
|00003be0| 76 69 65 77 73 2e 0a 58 | 20 20 42 59 54 45 27 73 |views..X| BYTE's|
|00003bf0| 20 55 4e 49 58 20 62 65 | 6e 63 68 6d 61 72 6b 69 | UNIX be|nchmarki|
|00003c00| 6e 67 20 73 75 69 74 65 | 20 69 73 20 73 6d 61 6c |ng suite| is smal|
|00003c10| 6c 20 65 6e 6f 75 67 68 | 20 74 6f 20 70 6f 72 74 |l enough| to port|
|00003c20| 20 65 61 73 69 6c 79 20 | 74 6f 20 61 6e 79 20 55 | easily |to any U|
|00003c30| 4e 49 58 0a 58 73 79 73 | 74 65 6d 2c 20 79 65 74 |NIX.Xsys|tem, yet|
|00003c40| 20 64 69 76 65 72 73 65 | 20 61 6e 64 20 66 6c 65 | diverse| and fle|
|00003c50| 78 69 62 6c 65 20 65 6e | 6f 75 67 68 20 74 6f 20 |xible en|ough to |
|00003c60| 62 65 20 75 73 65 66 75 | 6c 20 66 6f 72 20 61 20 |be usefu|l for a |
|00003c70| 77 69 64 65 20 73 70 65 | 63 74 72 75 6d 20 6f 66 |wide spe|ctrum of|
|00003c80| 0a 58 62 65 6e 63 68 6d | 61 72 6b 69 6e 67 20 72 |.Xbenchm|arking r|
|00003c90| 65 71 75 69 72 65 6d 65 | 6e 74 73 2e 20 42 65 73 |equireme|nts. Bes|
|00003ca0| 69 64 65 73 2c 20 74 68 | 65 79 27 72 65 20 69 6e |ides, th|ey're in|
|00003cb0| 20 74 68 65 20 70 75 62 | 6c 69 63 20 64 6f 6d 61 | the pub|lic doma|
|00003cc0| 69 6e 2c 20 73 6f 20 74 | 68 65 79 20 63 61 6e 0a |in, so t|hey can.|
|00003cd0| 58 62 65 20 6f 62 74 61 | 69 6e 65 64 20 66 6f 72 |Xbe obta|ined for|
|00003ce0| 20 6c 69 74 74 6c 65 2c | 20 69 66 20 61 6e 79 2c | little,| if any,|
|00003cf0| 20 63 6f 73 74 2e 20 57 | 68 61 74 20 62 65 74 74 | cost. W|hat bett|
|00003d00| 65 72 20 72 65 61 73 6f | 6e 20 64 6f 20 79 6f 75 |er reaso|n do you|
|00003d10| 20 6e 65 65 64 20 74 6f | 20 75 73 65 0a 58 74 68 | need to| use.Xth|
|00003d20| 65 6d 3f 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |em?.END_|OF_FILE.|
|00003d30| 69 66 20 74 65 73 74 20 | 31 34 36 38 32 20 2d 6e |if test |14682 -n|
|00003d40| 65 20 60 77 63 20 2d 63 | 20 3c 27 62 65 6e 63 68 |e `wc -c| <'bench|
|00003d50| 2e 64 6f 63 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |.doc'`; |then. |
|00003d60| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 62 | echo sh|ar: \"'b|
|00003d70| 65 6e 63 68 2e 64 6f 63 | 27 5c 22 20 75 6e 70 61 |ench.doc|'\" unpa|
|00003d80| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|00003d90| 73 69 7a 65 21 0a 66 69 | 0a 63 68 6d 6f 64 20 2b |size!.fi|.chmod +|
|00003da0| 78 20 27 62 65 6e 63 68 | 2e 64 6f 63 27 0a 23 20 |x 'bench|.doc'.# |
|00003db0| 65 6e 64 20 6f 66 20 27 | 62 65 6e 63 68 2e 64 6f |end of '|bench.do|
|00003dc0| 63 27 0a 66 69 0a 69 66 | 20 74 65 73 74 20 2d 66 |c'.fi.if| test -f|
|00003dd0| 20 27 62 69 67 2e 63 27 | 20 2d 61 20 22 24 7b 31 | 'big.c'| -a "${1|
|00003de0| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00003df0| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00003e00| 57 69 6c 6c 20 6e 6f 74 | 20 63 6c 6f 62 62 65 72 |Will not| clobber|
|00003e10| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00003e20| 22 27 62 69 67 2e 63 27 | 5c 22 0a 65 6c 73 65 0a |"'big.c'|\".else.|
|00003e30| 65 63 68 6f 20 73 68 61 | 72 3a 20 45 78 74 72 61 |echo sha|r: Extra|
|00003e40| 63 74 69 6e 67 20 5c 22 | 27 62 69 67 2e 63 27 5c |cting \"|'big.c'\|
|00003e50| 22 20 5c 28 31 33 37 35 | 30 20 63 68 61 72 61 63 |" \(1375|0 charac|
|00003e60| 74 65 72 73 5c 29 0a 73 | 65 64 20 22 73 2f 5e 58 |ters\).s|ed "s/^X|
|00003e70| 2f 2f 22 20 3e 27 62 69 | 67 2e 63 27 20 3c 3c 27 |//" >'bi|g.c' <<'|
|00003e80| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 27 0a 58 2f 2a |END_OF_F|ILE'.X/*|
|00003e90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ea0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003eb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ec0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ed0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 58 |********|******.X|
|00003ee0| 20 2a 20 20 54 68 65 20 | 42 59 54 45 20 55 4e 49 | * The |BYTE UNI|
|00003ef0| 58 20 42 65 6e 63 68 6d | 61 72 6b 73 20 2d 20 52 |X Benchm|arks - R|
|00003f00| 65 6c 65 61 73 65 20 32 | 0a 58 20 2a 20 20 20 20 |elease 2|.X * |
|00003f10| 20 20 20 20 20 20 4d 6f | 64 75 6c 65 3a 20 62 69 | Mo|dule: bi|
|00003f20| 67 2e 63 20 20 20 53 49 | 44 3a 20 32 2e 34 20 34 |g.c SI|D: 2.4 4|
|00003f30| 2f 31 37 2f 39 30 20 31 | 36 3a 34 35 3a 33 31 0a |/17/90 1|6:45:31.|
|00003f40| 58 20 2a 20 20 20 20 20 | 20 20 20 20 20 0a 58 20 |X * | .X |
|00003f50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0a |********|*******.|
|00003fa0| 58 20 2a 20 42 75 67 20 | 72 65 70 6f 72 74 73 2c |X * Bug |reports,|
|00003fb0| 20 70 61 74 63 68 65 73 | 2c 20 63 6f 6d 6d 65 6e | patches|, commen|
|00003fc0| 74 73 2c 20 73 75 67 67 | 65 73 74 69 6f 6e 73 20 |ts, sugg|estions |
|00003fd0| 73 68 6f 75 6c 64 20 62 | 65 20 73 65 6e 74 20 74 |should b|e sent t|
|00003fe0| 6f 3a 0a 58 20 2a 0a 58 | 20 2a 09 42 65 6e 20 53 |o:.X *.X| *.Ben S|
|00003ff0| 6d 69 74 68 20 6f 72 20 | 52 69 63 6b 20 47 72 65 |mith or |Rick Gre|
|00004000| 68 61 6e 20 61 74 20 42 | 59 54 45 20 4d 61 67 61 |han at B|YTE Maga|
|00004010| 7a 69 6e 65 0a 58 20 2a | 09 62 65 6e 73 6d 69 74 |zine.X *|.bensmit|
|00004020| 68 40 62 69 78 70 62 2e | 55 55 43 50 20 20 20 20 |h@bixpb.|UUCP |
|00004030| 72 69 63 6b 5f 67 40 62 | 69 78 70 62 2e 55 55 43 |rick_g@b|ixpb.UUC|
|00004040| 50 0a 58 20 2a 0a 58 20 | 2a 2a 2a 2a 2a 2a 2a 2a |P.X *.X |********|
|00004050| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004060| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004070| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|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 0a | 58 20 2a 20 20 4d 6f 64 |*******.|X * Mod|
|000040a0| 69 66 69 63 61 74 69 6f | 6e 20 4c 6f 67 3a 0a 58 |ificatio|n Log:.X|
|000040b0| 20 2a 0a 58 20 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | *.X ***|********|
|000040c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004100| 2a 2a 2a 2f 0a 58 63 68 | 61 72 20 53 43 43 53 69 |***/.Xch|ar SCCSi|
|00004110| 64 5b 5d 20 3d 20 22 40 | 28 23 29 20 40 28 23 29 |d[] = "@|(#) @(#)|
|00004120| 62 69 67 2e 63 3a 32 2e | 34 20 2d 2d 20 34 2f 31 |big.c:2.|4 -- 4/1|
|00004130| 37 2f 39 30 20 31 36 3a | 34 35 3a 33 31 22 3b 0a |7/90 16:|45:31";.|
|00004140| 58 2f 2a 0a 58 20 2a 20 | 20 64 75 6d 6d 79 20 63 |X/*.X * | dummy c|
|00004150| 6f 64 65 20 66 6f 72 20 | 65 78 65 63 6c 20 74 65 |ode for |execl te|
|00004160| 73 74 20 5b 20 6f 6c 64 | 20 76 65 72 73 69 6f 6e |st [ old| version|
|00004170| 20 6f 66 20 6d 61 6b 65 | 77 6f 72 6b 2e 63 20 5d | of make|work.c ]|
|00004180| 0a 58 20 2a 0a 58 20 2a | 20 20 6d 61 6b 65 77 6f |.X *.X *| makewo|
|00004190| 72 6b 20 5b 20 2d 72 20 | 72 61 74 65 20 5d 20 5b |rk [ -r |rate ] [|
|000041a0| 20 2d 63 20 63 6f 70 79 | 66 69 6c 65 20 5d 20 6e | -c copy|file ] n|
|000041b0| 75 73 65 72 73 0a 58 20 | 2a 0a 58 20 2a 20 20 6a |users.X |*.X * j|
|000041c0| 6f 62 20 73 74 72 65 61 | 6d 73 20 61 72 65 20 73 |ob strea|ms are s|
|000041d0| 70 65 63 69 66 69 65 64 | 20 6f 6e 20 73 74 61 6e |pecified| on stan|
|000041e0| 64 61 72 64 20 69 6e 70 | 75 74 20 77 69 74 68 20 |dard inp|ut with |
|000041f0| 6c 69 6e 65 73 20 6f 66 | 20 74 68 65 20 66 6f 72 |lines of| the for|
|00004200| 6d 0a 58 20 2a 20 20 66 | 75 6c 6c 5f 70 61 74 68 |m.X * f|ull_path|
|00004210| 5f 6e 61 6d 65 5f 66 6f | 72 5f 63 6f 6d 6d 61 6e |_name_fo|r_comman|
|00004220| 64 20 5b 20 6f 70 74 69 | 6f 6e 73 20 5d 20 5b 20 |d [ opti|ons ] [ |
|00004230| 3c 73 74 61 6e 64 61 72 | 64 5f 69 6e 70 75 74 5f |<standar|d_input_|
|00004240| 66 69 6c 65 20 5d 0a 58 | 20 2a 0a 58 20 2a 20 20 |file ].X| *.X * |
|00004250| 22 73 74 61 6e 64 61 72 | 64 20 69 6e 70 75 74 22 |"standar|d input"|
|00004260| 20 69 73 20 73 65 6e 64 | 20 74 6f 20 61 6c 6c 20 | is send| to all |
|00004270| 6e 75 73 65 72 20 69 6e | 73 74 61 6e 63 65 73 20 |nuser in|stances |
|00004280| 6f 66 20 74 68 65 20 63 | 6f 6d 6d 61 6e 64 73 20 |of the c|ommands |
|00004290| 69 6e 20 74 68 65 0a 58 | 20 2a 20 20 6a 6f 62 20 |in the.X| * job |
|000042a0| 73 74 72 65 61 6d 73 20 | 61 74 20 61 20 72 61 74 |streams |at a rat|
|000042b0| 65 20 6e 6f 74 20 69 6e | 20 65 78 63 65 73 73 20 |e not in| excess |
|000042c0| 6f 66 20 22 72 61 74 65 | 22 20 63 68 61 72 61 63 |of "rate|" charac|
|000042d0| 74 65 72 73 20 70 65 72 | 20 73 65 63 6f 6e 64 0a |ters per| second.|
|000042e0| 58 20 2a 20 20 70 65 72 | 20 63 6f 6d 6d 61 6e 64 |X * per| command|
|000042f0| 0a 58 20 2a 0a 58 20 2a | 2f 0a 58 0a 58 23 69 6e |.X *.X *|/.X.X#in|
|00004300| 63 6c 75 64 65 20 3c 73 | 74 64 69 6f 2e 68 3e 0a |clude <s|tdio.h>.|
|00004310| 58 23 69 6e 63 6c 75 64 | 65 20 3c 73 69 67 6e 61 |X#includ|e <signa|
|00004320| 6c 2e 68 3e 0a 58 0a 58 | 23 64 65 66 69 6e 65 20 |l.h>.X.X|#define |
|00004330| 44 45 46 5f 52 41 54 45 | 09 35 2e 30 0a 58 23 64 |DEF_RATE|.5.0.X#d|
|00004340| 65 66 69 6e 65 20 47 52 | 41 4e 55 4c 45 09 09 35 |efine GR|ANULE..5|
|00004350| 0a 58 23 64 65 66 69 6e | 65 20 43 48 55 4e 4b 09 |.X#defin|e CHUNK.|
|00004360| 09 36 30 0a 58 23 64 65 | 66 69 6e 65 20 4d 41 58 |.60.X#de|fine MAX|
|00004370| 43 48 49 4c 44 09 31 32 | 0a 58 23 64 65 66 69 6e |CHILD.12|.X#defin|
|00004380| 65 20 4d 41 58 57 4f 52 | 4b 09 09 31 30 0a 58 0a |e MAXWOR|K..10.X.|
|00004390| 58 66 6c 6f 61 74 09 74 | 68 72 65 73 3b 0a 58 66 |Xfloat.t|hres;.Xf|
|000043a0| 6c 6f 61 74 09 65 73 74 | 5f 72 61 74 65 20 3d 20 |loat.est|_rate = |
|000043b0| 44 45 46 5f 52 41 54 45 | 3b 0a 58 69 6e 74 09 6e |DEF_RATE|;.Xint.n|
|000043c0| 75 73 65 72 73 3b 09 09 | 2f 2a 20 6e 75 6d 62 65 |users;..|/* numbe|
|000043d0| 72 20 6f 66 20 63 6f 6e | 63 75 72 72 65 6e 74 20 |r of con|current |
|000043e0| 75 73 65 72 73 20 74 6f | 20 62 65 20 73 69 6d 75 |users to| be simu|
|000043f0| 6c 61 74 65 64 20 62 79 | 0a 58 09 09 09 20 2a 20 |lated by|.X... * |
|00004400| 74 68 69 73 20 70 72 6f | 63 65 73 73 20 2a 2f 0a |this pro|cess */.|
|00004410| 58 69 6e 74 09 66 69 72 | 73 74 75 73 65 72 3b 09 |Xint.fir|stuser;.|
|00004420| 2f 2a 20 6f 72 64 69 6e | 61 6c 20 69 64 65 6e 74 |/* ordin|al ident|
|00004430| 69 66 69 63 61 74 69 6f | 6e 20 6f 66 20 66 69 72 |ificatio|n of fir|
|00004440| 73 74 20 75 73 65 72 20 | 66 6f 72 20 74 68 69 73 |st user |for this|
|00004450| 0a 58 09 09 09 20 2a 20 | 70 72 6f 63 65 73 73 20 |.X... * |process |
|00004460| 2a 2f 0a 58 69 6e 74 09 | 6e 77 6f 72 6b 20 3d 20 |*/.Xint.|nwork = |
|00004470| 30 3b 09 2f 2a 20 6e 75 | 6d 62 65 72 20 6f 66 20 |0;./* nu|mber of |
|00004480| 6a 6f 62 20 73 74 72 65 | 61 6d 73 20 2a 2f 0a 58 |job stre|ams */.X|
|00004490| 69 6e 74 09 65 78 69 74 | 5f 73 74 61 74 75 73 20 |int.exit|_status |
|000044a0| 3d 20 30 3b 09 2f 2a 20 | 72 65 74 75 72 6e 65 64 |= 0;./* |returned|
|000044b0| 20 74 6f 20 70 61 72 65 | 6e 74 20 2a 2f 0a 58 69 | to pare|nt */.Xi|
|000044c0| 6e 74 09 73 69 67 70 69 | 70 65 3b 09 2f 2a 20 70 |nt.sigpi|pe;./* p|
|000044d0| 69 70 65 20 77 72 69 74 | 65 20 65 72 72 6f 72 20 |ipe writ|e error |
|000044e0| 66 6c 61 67 20 2a 2f 0a | 58 0a 58 73 74 72 75 63 |flag */.|X.Xstruc|
|000044f0| 74 20 73 74 5f 77 6f 72 | 6b 20 7b 0a 58 09 63 68 |t st_wor|k {.X.ch|
|00004500| 61 72 09 2a 63 6d 64 3b | 09 09 2f 2a 20 6e 61 6d |ar.*cmd;|../* nam|
|00004510| 65 20 6f 66 20 63 6f 6d | 6d 61 6e 64 20 74 6f 20 |e of com|mand to |
|00004520| 72 75 6e 20 2a 2f 0a 58 | 09 63 68 61 72 09 2a 2a |run */.X|.char.**|
|00004530| 61 76 3b 09 09 2f 2a 20 | 61 72 67 75 6d 65 6e 74 |av;../* |argument|
|00004540| 73 20 74 6f 20 63 6f 6d | 6d 61 6e 64 20 2a 2f 0a |s to com|mand */.|
|00004550| 58 09 63 68 61 72 09 2a | 69 6e 70 75 74 3b 09 09 |X.char.*|input;..|
|00004560| 2f 2a 20 73 74 61 6e 64 | 61 72 64 20 69 6e 70 75 |/* stand|ard inpu|
|00004570| 74 20 62 75 66 66 65 72 | 20 2a 2f 0a 58 09 69 6e |t buffer| */.X.in|
|00004580| 74 09 69 6e 70 73 69 7a | 65 3b 09 2f 2a 20 73 69 |t.inpsiz|e;./* si|
|00004590| 7a 65 20 6f 66 20 73 74 | 61 6e 64 61 72 64 20 69 |ze of st|andard i|
|000045a0| 6e 70 75 74 20 62 75 66 | 66 65 72 20 2a 2f 0a 58 |nput buf|fer */.X|
|000045b0| 09 63 68 61 72 09 2a 6f | 75 74 66 3b 09 09 2f 2a |.char.*o|utf;../*|
|000045c0| 20 73 74 61 6e 64 61 72 | 64 20 6f 75 74 70 75 74 | standar|d output|
|000045d0| 20 28 66 69 6c 65 6e 61 | 6d 65 29 20 2a 2f 0a 58 | (filena|me) */.X|
|000045e0| 7d 20 77 6f 72 6b 5b 4d | 41 58 57 4f 52 4b 5d 3b |} work[M|AXWORK];|
|000045f0| 0a 58 0a 58 73 74 72 75 | 63 74 20 7b 0a 58 09 69 |.X.Xstru|ct {.X.i|
|00004600| 6e 74 09 78 6d 69 74 3b | 09 2f 2a 20 23 20 63 68 |nt.xmit;|./* # ch|
|00004610| 61 72 61 63 74 65 72 73 | 20 73 65 6e 74 20 2a 2f |aracters| sent */|
|00004620| 0a 58 09 63 68 61 72 09 | 2a 62 70 3b 09 2f 2a 20 |.X.char.|*bp;./* |
|00004630| 73 74 64 20 69 6e 70 75 | 74 20 62 75 66 66 65 72 |std inpu|t buffer|
|00004640| 20 70 6f 69 6e 74 65 72 | 20 2a 2f 0a 58 09 69 6e | pointer| */.X.in|
|00004650| 74 09 62 6c 65 6e 3b 09 | 2f 2a 20 73 74 64 20 69 |t.blen;.|/* std i|
|00004660| 6e 70 75 74 20 62 75 66 | 66 65 72 20 6c 65 6e 67 |nput buf|fer leng|
|00004670| 74 68 20 2a 2f 0a 58 09 | 69 6e 74 09 66 64 3b 09 |th */.X.|int.fd;.|
|00004680| 2f 2a 20 73 74 64 69 6e | 20 74 6f 20 63 6f 6d 6d |/* stdin| to comm|
|00004690| 61 6e 64 20 2a 2f 0a 58 | 09 69 6e 74 09 70 69 64 |and */.X|.int.pid|
|000046a0| 3b 09 2f 2a 20 63 68 69 | 6c 64 20 50 49 44 20 2a |;./* chi|ld PID *|
|000046b0| 2f 0a 58 09 63 68 61 72 | 09 2a 6c 69 6e 65 3b 09 |/.X.char|.*line;.|
|000046c0| 2f 2a 20 73 74 61 72 74 | 20 6f 66 20 69 6e 70 75 |/* start| of inpu|
|000046d0| 74 20 6c 69 6e 65 20 2a | 2f 20 0a 58 09 69 6e 74 |t line *|/ .X.int|
|000046e0| 09 66 69 72 73 74 6a 6f | 62 3b 09 2f 2a 20 69 6e |.firstjo|b;./* in|
|000046f0| 69 74 61 6c 20 70 69 65 | 63 65 20 6f 66 20 77 6f |ital pie|ce of wo|
|00004700| 72 6b 20 2a 2f 0a 58 09 | 69 6e 74 09 74 68 69 73 |rk */.X.|int.this|
|00004710| 6a 6f 62 3b 09 2f 2a 20 | 63 75 72 72 65 6e 74 20 |job;./* |current |
|00004720| 70 69 65 63 65 20 6f 66 | 20 77 6f 72 6b 20 2a 2f |piece of| work */|
|00004730| 0a 58 7d 20 63 68 69 6c | 64 5b 4d 41 58 43 48 49 |.X} chil|d[MAXCHI|
|00004740| 4c 44 5d 2c 20 2a 63 70 | 3b 0a 58 0a 58 6d 61 69 |LD], *cp|;.X.Xmai|
|00004750| 6e 28 61 72 67 63 2c 20 | 61 72 67 76 29 0a 58 69 |n(argc, |argv).Xi|
|00004760| 6e 74 09 61 72 67 63 3b | 0a 58 63 68 61 72 09 2a |nt.argc;|.Xchar.*|
|00004770| 61 72 67 76 5b 5d 3b 0a | 58 7b 0a 58 20 20 20 20 |argv[];.|X{.X |
|00004780| 69 6e 74 09 09 69 3b 0a | 58 20 20 20 20 69 6e 74 |int..i;.|X int|
|00004790| 09 09 6c 3b 0a 58 20 20 | 20 20 69 6e 74 09 09 66 |..l;.X | int..f|
|000047a0| 63 6f 70 79 20 3d 20 30 | 3b 09 2f 2a 20 66 64 20 |copy = 0|;./* fd |
|000047b0| 66 6f 72 20 63 6f 70 79 | 20 6f 75 74 70 75 74 20 |for copy| output |
|000047c0| 2a 2f 0a 58 20 20 20 20 | 69 6e 74 09 09 6d 61 73 |*/.X |int..mas|
|000047d0| 74 65 72 20 3d 20 31 3b | 09 2f 2a 20 74 68 65 20 |ter = 1;|./* the |
|000047e0| 52 45 41 4c 20 6d 61 73 | 74 65 72 2c 20 3d 3d 20 |REAL mas|ter, == |
|000047f0| 30 20 66 6f 72 20 63 6c | 6f 6e 65 73 20 2a 2f 0a |0 for cl|ones */.|
|00004800| 58 20 20 20 20 69 6e 74 | 09 09 6e 63 68 69 6c 64 |X int|..nchild|
|00004810| 3b 09 09 2f 2a 20 6e 6f | 2e 20 6f 66 20 63 68 69 |;../* no|. of chi|
|00004820| 6c 64 72 65 6e 20 66 6f | 72 20 61 20 63 6c 6f 6e |ldren fo|r a clon|
|00004830| 65 20 74 6f 20 72 75 6e | 20 2a 2f 0a 58 20 20 20 |e to run| */.X |
|00004840| 20 69 6e 74 09 09 64 6f | 6e 65 3b 09 09 2f 2a 20 | int..do|ne;../* |
|00004850| 63 6f 75 6e 74 20 6f 66 | 20 63 68 69 6c 64 72 65 |count of| childre|
|00004860| 6e 20 66 69 6e 69 73 68 | 65 64 20 2a 2f 0a 58 20 |n finish|ed */.X |
|00004870| 20 20 20 69 6e 74 09 09 | 6f 75 74 70 75 74 3b 09 | int..|output;.|
|00004880| 09 2f 2a 20 61 67 67 72 | 65 67 61 74 65 20 6f 75 |./* aggr|egate ou|
|00004890| 74 70 75 74 20 63 68 61 | 72 20 63 6f 75 6e 74 20 |tput cha|r count |
|000048a0| 66 6f 72 20 61 6c 6c 0a | 58 09 09 09 09 20 20 20 |for all.|X.... |
|000048b0| 63 68 69 6c 64 72 65 6e | 20 2a 2f 0a 58 20 20 20 |children| */.X |
|000048c0| 20 69 6e 74 09 09 63 3b | 0a 58 20 20 20 20 69 6e | int..c;|.X in|
|000048d0| 74 09 09 74 68 69 73 77 | 6f 72 6b 20 3d 20 30 3b |t..thisw|ork = 0;|
|000048e0| 09 2f 2a 20 6e 65 78 74 | 20 6a 6f 62 20 73 74 72 |./* next| job str|
|000048f0| 65 61 6d 20 74 6f 20 61 | 6c 6c 6f 63 61 74 65 20 |eam to a|llocate |
|00004900| 2a 2f 0a 58 20 20 20 20 | 69 6e 74 09 09 6e 63 68 |*/.X |int..nch|
|00004910| 3b 09 09 2f 2a 20 23 20 | 63 68 61 72 61 63 74 65 |;../* # |characte|
|00004920| 72 73 20 74 6f 20 77 72 | 69 74 65 20 2a 2f 0a 58 |rs to wr|ite */.X|
|00004930| 20 20 20 20 69 6e 74 09 | 09 77 72 69 74 74 65 6e | int.|.written|
|00004940| 3b 09 2f 2a 20 23 20 63 | 68 61 72 61 63 74 65 72 |;./* # c|haracter|
|00004950| 73 20 61 63 74 75 6c 6c | 79 20 77 72 69 74 74 65 |s actull|y writte|
|00004960| 6e 20 2a 2f 0a 58 20 20 | 20 20 63 68 61 72 09 6c |n */.X | char.l|
|00004970| 6f 67 6e 61 6d 65 5b 31 | 35 5d 3b 09 2f 2a 20 6e |ogname[1|5];./* n|
|00004980| 61 6d 65 20 6f 66 20 74 | 68 65 20 6c 6f 67 20 66 |ame of t|he log f|
|00004990| 69 6c 65 28 73 29 20 2a | 2f 0a 58 20 20 20 20 69 |ile(s) *|/.X i|
|000049a0| 6e 74 09 09 6f 6e 61 6c | 61 72 6d 28 29 3b 0a 58 |nt..onal|arm();.X|
|000049b0| 20 20 20 20 69 6e 74 09 | 09 70 69 70 65 65 72 72 | int.|.pipeerr|
|000049c0| 28 29 3b 0a 58 20 20 20 | 20 69 6e 74 09 09 77 72 |();.X | int..wr|
|000049d0| 61 70 75 70 28 29 3b 0a | 58 20 20 20 20 69 6e 74 |apup();.|X int|
|000049e0| 09 09 67 72 75 6e 74 28 | 29 3b 0a 58 20 20 20 20 |..grunt(|);.X |
|000049f0| 69 6e 74 09 09 70 76 65 | 63 5b 32 5d 3b 09 2f 2a |int..pve|c[2];./*|
|00004a00| 20 66 6f 72 20 70 69 70 | 65 73 20 2a 2f 0a 58 20 | for pip|es */.X |
|00004a10| 20 20 20 63 68 61 72 09 | 2a 70 3b 0a 58 20 20 20 | char.|*p;.X |
|00004a20| 20 63 68 61 72 09 2a 70 | 72 6f 67 3b 09 09 2f 2a | char.*p|rog;../*|
|00004a30| 20 6d 79 20 6e 61 6d 65 | 20 2a 2f 0a 58 0a 58 23 | my name| */.X.X#|
|00004a40| 69 66 20 21 20 64 65 62 | 75 67 0a 58 20 20 20 20 |if ! deb|ug.X |
|00004a50| 66 72 65 6f 70 65 6e 28 | 22 6d 61 73 74 65 72 6c |freopen(|"masterl|
|00004a60| 6f 67 2e 30 30 22 2c 20 | 22 61 22 2c 20 73 74 64 |og.00", |"a", std|
|00004a70| 65 72 72 29 3b 0a 58 23 | 65 6e 64 69 66 0a 58 20 |err);.X#|endif.X |
|00004a80| 20 20 20 66 70 72 69 6e | 74 66 28 73 74 64 65 72 | fprin|tf(stder|
|00004a90| 72 2c 20 22 2a 2a 2a 20 | 4e 65 77 20 52 75 6e 20 |r, "*** |New Run |
|00004aa0| 2a 2a 2a 20 20 22 29 3b | 0a 58 20 20 20 20 70 72 |*** ");|.X pr|
|00004ab0| 6f 67 20 3d 20 61 72 67 | 76 5b 30 5d 3b 0a 58 20 |og = arg|v[0];.X |
|00004ac0| 20 20 20 77 68 69 6c 65 | 20 28 61 72 67 63 20 3e | while| (argc >|
|00004ad0| 20 31 20 26 26 20 61 72 | 67 76 5b 31 5d 5b 30 5d | 1 && ar|gv[1][0]|
|00004ae0| 20 3d 3d 20 27 2d 27 29 | 20 20 7b 0a 58 09 70 20 | == '-')| {.X.p |
|00004af0| 3d 20 26 61 72 67 76 5b | 31 5d 5b 31 5d 3b 0a 58 |= &argv[|1][1];.X|
|00004b00| 09 61 72 67 63 2d 2d 3b | 0a 58 09 61 72 67 76 2b |.argc--;|.X.argv+|
|00004b10| 2b 3b 0a 58 09 77 68 69 | 6c 65 20 28 2a 70 29 20 |+;.X.whi|le (*p) |
|00004b20| 7b 0a 58 09 20 20 20 20 | 73 77 69 74 63 68 20 28 |{.X. |switch (|
|00004b30| 2a 70 29 20 7b 0a 58 09 | 20 20 20 20 63 61 73 65 |*p) {.X.| case|
|00004b40| 20 27 72 27 3a 0a 58 09 | 09 09 65 73 74 5f 72 61 | 'r':.X.|..est_ra|
|00004b50| 74 65 20 3d 20 61 74 6f | 69 28 61 72 67 76 5b 31 |te = ato|i(argv[1|
|00004b60| 5d 29 3b 0a 58 09 09 09 | 73 73 63 61 6e 66 28 61 |]);.X...|sscanf(a|
|00004b70| 72 67 76 5b 31 5d 2c 20 | 22 25 66 22 2c 20 26 65 |rgv[1], |"%f", &e|
|00004b80| 73 74 5f 72 61 74 65 29 | 3b 0a 58 09 09 09 69 66 |st_rate)|;.X...if|
|00004b90| 20 28 65 73 74 5f 72 61 | 74 65 20 3c 3d 20 30 29 | (est_ra|te <= 0)|
|00004ba0| 20 7b 0a 58 09 09 09 20 | 20 20 20 66 70 72 69 6e | {.X... | fprin|
|00004bb0| 74 66 28 73 74 64 65 72 | 72 2c 20 22 25 73 3a 20 |tf(stder|r, "%s: |
|00004bc0| 62 61 64 20 72 61 74 65 | 2c 20 72 65 73 65 74 20 |bad rate|, reset |
|00004bd0| 74 6f 20 25 2e 32 66 20 | 63 68 61 72 73 2f 73 65 |to %.2f |chars/se|
|00004be0| 63 5c 6e 22 2c 20 70 72 | 6f 67 2c 20 44 45 46 5f |c\n", pr|og, DEF_|
|00004bf0| 52 41 54 45 29 3b 0a 58 | 09 09 09 20 20 20 20 65 |RATE);.X|... e|
|00004c00| 73 74 5f 72 61 74 65 20 | 3d 20 44 45 46 5f 52 41 |st_rate |= DEF_RA|
|00004c10| 54 45 3b 0a 58 09 09 09 | 7d 0a 58 09 09 09 61 72 |TE;.X...|}.X...ar|
|00004c20| 67 63 2d 2d 3b 0a 58 09 | 09 09 61 72 67 76 2b 2b |gc--;.X.|..argv++|
|00004c30| 3b 0a 58 09 09 09 62 72 | 65 61 6b 3b 0a 58 0a 58 |;.X...br|eak;.X.X|
|00004c40| 09 20 20 20 20 63 61 73 | 65 20 27 63 27 3a 0a 58 |. cas|e 'c':.X|
|00004c50| 09 09 09 66 63 6f 70 79 | 20 3d 20 6f 70 65 6e 28 |...fcopy| = open(|
|00004c60| 61 72 67 76 5b 31 5d 2c | 20 31 29 3b 0a 58 09 09 |argv[1],| 1);.X..|
|00004c70| 09 69 66 20 28 66 63 6f | 70 79 20 3c 20 30 29 0a |.if (fco|py < 0).|
|00004c80| 58 09 09 09 09 66 63 6f | 70 79 20 3d 20 63 72 65 |X....fco|py = cre|
|00004c90| 61 74 28 61 72 67 76 5b | 31 5d 2c 20 30 36 30 30 |at(argv[|1], 0600|
|00004ca0| 29 3b 0a 58 09 09 09 69 | 66 20 28 66 63 6f 70 79 |);.X...i|f (fcopy|
|00004cb0| 20 3c 20 30 29 20 7b 0a | 58 09 09 09 20 20 20 20 | < 0) {.|X... |
|00004cc0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|00004cd0| 22 25 73 3a 20 63 61 6e | 6e 6f 74 20 6f 70 65 6e |"%s: can|not open|
|00004ce0| 20 63 6f 70 79 20 66 69 | 6c 65 20 27 25 73 27 5c | copy fi|le '%s'\|
|00004cf0| 6e 22 2c 0a 58 09 09 09 | 09 70 72 6f 67 2c 20 61 |n",.X...|.prog, a|
|00004d00| 72 67 76 5b 31 5d 29 3b | 0a 58 09 09 09 20 20 20 |rgv[1]);|.X... |
|00004d10| 20 65 78 69 74 28 32 29 | 3b 0a 58 09 09 09 7d 0a | exit(2)|;.X...}.|
|00004d20| 58 09 09 09 6c 73 65 65 | 6b 28 66 63 6f 70 79 2c |X...lsee|k(fcopy,|
|00004d30| 20 30 4c 2c 20 32 29 3b | 09 2f 2a 20 61 70 70 65 | 0L, 2);|./* appe|
|00004d40| 6e 64 20 61 74 20 65 6e | 64 20 6f 66 20 66 69 6c |nd at en|d of fil|
|00004d50| 65 20 2a 2f 0a 58 09 09 | 09 61 72 67 63 2d 2d 3b |e */.X..|.argc--;|
|00004d60| 0a 58 09 09 09 61 72 67 | 76 2b 2b 3b 0a 58 09 09 |.X...arg|v++;.X..|
|00004d70| 09 62 72 65 61 6b 3b 0a | 58 0a 58 09 20 20 20 20 |.break;.|X.X. |
|00004d80| 64 65 66 61 75 6c 74 3a | 0a 58 09 09 66 70 72 69 |default:|.X..fpri|
|00004d90| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 25 73 3a |ntf(stde|rr, "%s:|
|00004da0| 20 62 61 64 20 66 6c 61 | 67 20 27 25 63 27 5c 6e | bad fla|g '%c'\n|
|00004db0| 22 2c 20 70 72 6f 67 2c | 20 2a 70 29 3b 0a 58 09 |", prog,| *p);.X.|
|00004dc0| 09 09 65 78 69 74 28 34 | 29 3b 0a 58 09 20 20 20 |..exit(4|);.X. |
|00004dd0| 20 7d 0a 58 09 20 20 20 | 20 70 2b 2b 3b 0a 58 09 | }.X. | p++;.X.|
|00004de0| 7d 0a 58 20 20 20 20 7d | 0a 58 20 20 20 20 0a 58 |}.X }|.X .X|
|00004df0| 20 20 20 20 69 66 20 28 | 61 72 67 63 20 3c 20 32 | if (|argc < 2|
|00004e00| 29 20 7b 0a 58 09 66 70 | 72 69 6e 74 66 28 73 74 |) {.X.fp|rintf(st|
|00004e10| 64 65 72 72 2c 20 22 25 | 73 3a 20 6d 69 73 73 69 |derr, "%|s: missi|
|00004e20| 6e 67 20 6e 75 73 65 72 | 73 5c 6e 22 2c 20 70 72 |ng nuser|s\n", pr|
|00004e30| 6f 67 29 3b 0a 58 09 65 | 78 69 74 28 34 29 3b 0a |og);.X.e|xit(4);.|
|00004e40| 58 20 20 20 20 7d 0a 58 | 0a 58 20 20 20 20 6e 75 |X }.X|.X nu|
|00004e50| 73 65 72 73 20 3d 20 61 | 74 6f 69 28 61 72 67 76 |sers = a|toi(argv|
|00004e60| 5b 31 5d 29 3b 0a 58 20 | 20 20 20 69 66 20 28 6e |[1]);.X | if (n|
|00004e70| 75 73 65 72 73 20 3c 20 | 31 29 20 7b 0a 58 09 66 |users < |1) {.X.f|
|00004e80| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "|
|00004e90| 25 73 3a 20 69 6d 70 6f | 73 73 69 62 6c 65 20 6e |%s: impo|ssible n|
|00004ea0| 75 73 65 72 73 20 28 25 | 64 3c 2d 25 73 29 5c 6e |users (%|d<-%s)\n|
|00004eb0| 22 2c 20 70 72 6f 67 2c | 20 6e 75 73 65 72 73 2c |", prog,| nusers,|
|00004ec0| 20 61 72 67 76 5b 31 5d | 29 3b 0a 58 09 65 78 69 | argv[1]|);.X.exi|
|00004ed0| 74 28 34 29 3b 0a 58 20 | 20 20 20 7d 0a 58 20 20 |t(4);.X | }.X |
|00004ee0| 20 20 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 | fprint|f(stderr|
|00004ef0| 2c 20 22 25 64 20 55 73 | 65 72 73 5c 6e 22 2c 20 |, "%d Us|ers\n", |
|00004f00| 6e 75 73 65 72 73 29 3b | 0a 58 20 20 20 20 61 72 |nusers);|.X ar|
|00004f10| 67 63 2d 2d 3b 0a 58 20 | 20 20 20 61 72 67 76 2b |gc--;.X | argv+|
|00004f20| 2b 3b 0a 58 0a 58 20 20 | 20 20 2f 2a 20 62 75 69 |+;.X.X | /* bui|
|00004f30| 6c 64 20 6a 6f 62 20 73 | 74 72 65 61 6d 73 20 2a |ld job s|treams *|
|00004f40| 2f 0a 58 20 20 20 20 67 | 65 74 77 6f 72 6b 28 29 |/.X g|etwork()|
|00004f50| 3b 0a 58 23 69 66 20 64 | 65 62 75 67 0a 58 20 20 |;.X#if d|ebug.X |
|00004f60| 20 20 64 75 6d 70 77 6f | 72 6b 28 29 3b 0a 58 23 | dumpwo|rk();.X#|
|00004f70| 65 6e 64 69 66 0a 58 0a | 58 20 20 20 20 2f 2a 20 |endif.X.|X /* |
|00004f80| 63 6c 6f 6e 65 20 63 6f | 70 69 65 73 20 6f 66 20 |clone co|pies of |
|00004f90| 6d 79 73 65 6c 66 20 74 | 6f 20 72 75 6e 20 75 70 |myself t|o run up|
|00004fa0| 20 74 6f 20 4d 41 58 43 | 48 49 4c 44 20 6a 6f 62 | to MAXC|HILD job|
|00004fb0| 73 20 65 61 63 68 20 2a | 2f 0a 58 20 20 20 20 66 |s each *|/.X f|
|00004fc0| 69 72 73 74 75 73 65 72 | 20 3d 20 4d 41 58 43 48 |irstuser| = MAXCH|
|00004fd0| 49 4c 44 3b 0a 58 20 20 | 20 20 66 70 72 69 6e 74 |ILD;.X | fprint|
|00004fe0| 66 28 73 74 64 65 72 72 | 2c 20 22 6d 61 73 74 65 |f(stderr|, "maste|
|00004ff0| 72 20 70 69 64 20 25 64 | 5c 6e 22 2c 20 67 65 74 |r pid %d|\n", get|
|00005000| 70 69 64 28 29 29 3b 0a | 58 20 20 20 20 66 66 6c |pid());.|X ffl|
|00005010| 75 73 68 28 73 74 64 65 | 72 72 29 3b 0a 58 20 20 |ush(stde|rr);.X |
|00005020| 20 20 77 68 69 6c 65 20 | 28 6e 75 73 65 72 73 20 | while |(nusers |
|00005030| 3e 20 4d 41 58 43 48 49 | 4c 44 29 20 7b 0a 58 09 |> MAXCHI|LD) {.X.|
|00005040| 66 66 6c 75 73 68 28 73 | 74 64 65 72 72 29 3b 0a |fflush(s|tderr);.|
|00005050| 58 09 69 66 20 28 6e 75 | 73 65 72 73 20 3e 3d 20 |X.if (nu|sers >= |
|00005060| 32 2a 4d 41 58 43 48 49 | 4c 44 29 0a 58 09 20 20 |2*MAXCHI|LD).X. |
|00005070| 20 20 2f 2a 20 74 68 65 | 20 6e 65 78 74 20 63 6c | /* the| next cl|
|00005080| 6f 6e 65 20 6d 75 73 74 | 20 72 75 6e 20 4d 41 58 |one must| run MAX|
|00005090| 43 48 49 4c 44 20 6a 6f | 62 73 20 2a 2f 0a 58 09 |CHILD jo|bs */.X.|
|000050a0| 20 20 20 20 6e 63 68 69 | 6c 64 20 3d 20 4d 41 58 | nchi|ld = MAX|
|000050b0| 43 48 49 4c 44 3b 0a 58 | 09 65 6c 73 65 0a 58 09 |CHILD;.X|.else.X.|
|000050c0| 20 20 20 20 2f 2a 20 74 | 68 65 20 6e 65 78 74 20 | /* t|he next |
|000050d0| 63 6c 6f 6e 65 20 6d 75 | 73 74 20 72 75 6e 20 74 |clone mu|st run t|
|000050e0| 68 65 20 6c 65 66 74 6f | 76 65 72 20 6a 6f 62 73 |he lefto|ver jobs|
|000050f0| 20 2a 2f 0a 58 09 20 20 | 20 20 6e 63 68 69 6c 64 | */.X. | nchild|
|00005100| 20 3d 20 6e 75 73 65 72 | 73 20 2d 20 4d 41 58 43 | = nuser|s - MAXC|
|00005110| 48 49 4c 44 3b 0a 58 09 | 69 66 20 28 28 6c 20 3d |HILD;.X.|if ((l =|
|00005120| 20 66 6f 72 6b 28 29 29 | 20 3d 3d 20 2d 31 29 20 | fork())| == -1) |
|00005130| 7b 0a 58 09 20 20 20 20 | 2f 2a 20 66 6f 72 6b 20 |{.X. |/* fork |
|00005140| 66 61 69 6c 65 64 20 2a | 2f 0a 58 09 20 20 20 20 |failed *|/.X. |
|00005150| 66 61 74 61 6c 28 22 2a | 2a 20 63 6c 6f 6e 65 20 |fatal("*|* clone |
|00005160| 66 6f 72 6b 20 66 61 69 | 6c 65 64 20 2a 2a 5c 6e |fork fai|led **\n|
|00005170| 22 29 3b 0a 58 09 20 20 | 20 20 67 6f 74 6f 20 62 |");.X. | goto b|
|00005180| 65 70 61 74 69 65 6e 74 | 3b 0a 58 09 7d 20 65 6c |epatient|;.X.} el|
|00005190| 73 65 20 69 66 20 28 6c | 20 3e 20 30 29 20 7b 0a |se if (l| > 0) {.|
|000051a0| 58 09 20 20 20 20 66 70 | 72 69 6e 74 66 28 73 74 |X. fp|rintf(st|
|000051b0| 64 65 72 72 2c 20 22 6d | 61 73 74 65 72 20 63 6c |derr, "m|aster cl|
|000051c0| 6f 6e 65 20 70 69 64 20 | 25 64 5c 6e 22 2c 20 6c |one pid |%d\n", l|
|000051d0| 29 3b 0a 58 09 20 20 20 | 20 2f 2a 20 49 20 61 6d |);.X. | /* I am|
|000051e0| 20 74 68 65 20 6d 61 73 | 74 65 72 20 77 69 74 68 | the mas|ter with|
|000051f0| 20 6e 63 68 69 6c 64 20 | 66 65 77 65 72 20 6a 6f | nchild |fewer jo|
|00005200| 62 73 20 74 6f 20 72 75 | 6e 20 2a 2f 0a 58 09 20 |bs to ru|n */.X. |
|00005210| 20 20 20 6e 75 73 65 72 | 73 20 2d 3d 20 6e 63 68 | nuser|s -= nch|
|00005220| 69 6c 64 3b 0a 58 09 20 | 20 20 20 66 69 72 73 74 |ild;.X. | first|
|00005230| 75 73 65 72 20 2b 3d 20 | 4d 41 58 43 48 49 4c 44 |user += |MAXCHILD|
|00005240| 3b 0a 58 09 20 20 20 20 | 63 6f 6e 74 69 6e 75 65 |;.X. |continue|
|00005250| 3b 0a 58 09 7d 20 65 6c | 73 65 20 7b 0a 58 09 20 |;.X.} el|se {.X. |
|00005260| 20 20 20 2f 2a 20 49 20 | 61 6d 20 61 20 63 6c 6f | /* I |am a clo|
|00005270| 6e 65 2c 20 72 75 6e 20 | 4d 41 58 43 48 49 4c 44 |ne, run |MAXCHILD|
|00005280| 20 6a 6f 62 73 20 2a 2f | 0a 58 23 69 66 20 21 20 | jobs */|.X#if ! |
|00005290| 64 65 62 75 67 0a 58 09 | 20 20 20 20 73 70 72 69 |debug.X.| spri|
|000052a0| 6e 74 66 28 6c 6f 67 6e | 61 6d 65 2c 20 22 6d 61 |ntf(logn|ame, "ma|
|000052b0| 73 74 65 72 6c 6f 67 2e | 25 30 32 64 22 2c 20 66 |sterlog.|%02d", f|
|000052c0| 69 72 73 74 75 73 65 72 | 2f 4d 41 58 43 48 49 4c |irstuser|/MAXCHIL|
|000052d0| 44 29 3b 0a 58 09 20 20 | 20 20 66 72 65 6f 70 65 |D);.X. | freope|
|000052e0| 6e 28 6c 6f 67 6e 61 6d | 65 2c 20 22 77 22 2c 20 |n(lognam|e, "w", |
|000052f0| 73 74 64 65 72 72 29 3b | 0a 58 23 65 6e 64 69 66 |stderr);|.X#endif|
|00005300| 0a 58 09 20 20 20 20 6d | 61 73 74 65 72 20 3d 20 |.X. m|aster = |
|00005310| 30 3b 0a 58 09 20 20 20 | 20 6e 75 73 65 72 73 20 |0;.X. | nusers |
|00005320| 3d 20 6e 63 68 69 6c 64 | 3b 0a 58 09 20 20 20 20 |= nchild|;.X. |
|00005330| 62 72 65 61 6b 3b 0a 58 | 09 7d 0a 58 20 20 20 20 |break;.X|.}.X |
|00005340| 7d 0a 58 20 20 20 20 69 | 66 20 28 6d 61 73 74 65 |}.X i|f (maste|
|00005350| 72 29 0a 58 09 66 69 72 | 73 74 75 73 65 72 20 3d |r).X.fir|stuser =|
|00005360| 20 30 3b 0a 58 0a 58 20 | 20 20 20 63 6c 6f 73 65 | 0;.X.X | close|
|00005370| 28 30 29 3b 0a 58 20 20 | 20 20 66 6f 72 20 28 69 |(0);.X | for (i|
|00005380| 20 3d 20 30 3b 20 69 20 | 3c 20 6e 75 73 65 72 73 | = 0; i |< nusers|
|00005390| 3b 20 69 2b 2b 20 29 20 | 7b 0a 58 09 66 70 72 69 |; i++ ) |{.X.fpri|
|000053a0| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 75 73 65 |ntf(stde|rr, "use|
|000053b0| 72 20 25 64 20 6a 6f 62 | 20 25 64 20 22 2c 20 66 |r %d job| %d ", f|
|000053c0| 69 72 73 74 75 73 65 72 | 2b 69 2c 20 74 68 69 73 |irstuser|+i, this|
|000053d0| 77 6f 72 6b 29 3b 0a 58 | 09 69 66 20 28 70 69 70 |work);.X|.if (pip|
|000053e0| 65 28 70 76 65 63 29 20 | 3d 3d 20 2d 31 29 20 7b |e(pvec) |== -1) {|
|000053f0| 0a 58 09 20 20 20 20 2f | 2a 20 74 68 69 73 20 69 |.X. /|* this i|
|00005400| 73 20 66 61 74 61 6c 20 | 2a 2f 0a 58 09 20 20 20 |s fatal |*/.X. |
|00005410| 20 66 61 74 61 6c 28 22 | 2a 2a 20 70 69 70 65 20 | fatal("|** pipe |
|00005420| 66 61 69 6c 65 64 20 2a | 2a 5c 6e 22 29 3b 0a 58 |failed *|*\n");.X|
|00005430| 09 20 20 20 20 67 6f 74 | 6f 20 62 65 70 61 74 69 |. got|o bepati|
|00005440| 65 6e 74 3b 0a 58 09 7d | 0a 58 09 66 66 6c 75 73 |ent;.X.}|.X.fflus|
|00005450| 68 28 73 74 64 65 72 72 | 29 3b 0a 58 09 69 66 20 |h(stderr|);.X.if |
|00005460| 28 28 63 68 69 6c 64 5b | 69 5d 2e 70 69 64 20 3d |((child[|i].pid =|
|00005470| 20 66 6f 72 6b 28 29 29 | 20 3d 3d 20 30 29 20 7b | fork())| == 0) {|
|00005480| 0a 58 09 20 20 20 20 69 | 6e 74 09 66 64 3b 0a 58 |.X. i|nt.fd;.X|
|00005490| 09 20 20 20 20 2f 2a 20 | 74 68 65 20 63 6f 6d 6d |. /* |the comm|
|000054a0| 61 6e 64 20 2a 2f 0a 58 | 09 20 20 20 20 69 66 20 |and */.X|. if |
|000054b0| 28 70 76 65 63 5b 30 5d | 20 21 3d 20 30 29 20 7b |(pvec[0]| != 0) {|
|000054c0| 0a 58 09 09 63 6c 6f 73 | 65 28 30 29 3b 0a 58 09 |.X..clos|e(0);.X.|
|000054d0| 09 64 75 70 28 70 76 65 | 63 5b 30 5d 29 3b 0a 58 |.dup(pve|c[0]);.X|
|000054e0| 09 20 20 20 20 7d 0a 58 | 23 69 66 20 21 20 64 65 |. }.X|#if ! de|
|000054f0| 62 75 67 0a 58 09 20 20 | 20 20 73 70 72 69 6e 74 |bug.X. | sprint|
|00005500| 66 28 6c 6f 67 6e 61 6d | 65 2c 20 22 75 73 65 72 |f(lognam|e, "user|
|00005510| 6c 6f 67 2e 25 30 32 64 | 22 2c 20 66 69 72 73 74 |log.%02d|", first|
|00005520| 75 73 65 72 2b 69 29 3b | 0a 58 09 20 20 20 20 66 |user+i);|.X. f|
|00005530| 72 65 6f 70 65 6e 28 6c | 6f 67 6e 61 6d 65 2c 20 |reopen(l|ogname, |
|00005540| 22 77 22 2c 20 73 74 64 | 65 72 72 29 3b 0a 58 23 |"w", std|err);.X#|
|00005550| 65 6e 64 69 66 0a 58 09 | 20 20 20 20 66 6f 72 20 |endif.X.| for |
|00005560| 28 66 64 20 3d 20 33 3b | 20 66 64 20 3c 20 32 34 |(fd = 3;| fd < 24|
|00005570| 3b 20 66 64 2b 2b 29 0a | 58 09 09 63 6c 6f 73 65 |; fd++).|X..close|
|00005580| 28 66 64 29 3b 0a 58 09 | 20 20 20 20 69 66 20 28 |(fd);.X.| if (|
|00005590| 77 6f 72 6b 5b 74 68 69 | 73 77 6f 72 6b 5d 2e 6f |work[thi|swork].o|
|000055a0| 75 74 66 5b 30 5d 20 21 | 3d 20 27 5c 30 27 29 20 |utf[0] !|= '\0') |
|000055b0| 7b 0a 58 09 09 2f 2a 20 | 72 65 64 69 72 65 63 74 |{.X../* |redirect|
|000055c0| 20 73 74 64 20 6f 75 74 | 70 75 74 20 2a 2f 0a 58 | std out|put */.X|
|000055d0| 09 09 63 68 61 72 09 2a | 71 3b 0a 58 09 09 66 6f |..char.*|q;.X..fo|
|000055e0| 72 20 28 71 20 3d 20 77 | 6f 72 6b 5b 74 68 69 73 |r (q = w|ork[this|
|000055f0| 77 6f 72 6b 5d 2e 6f 75 | 74 66 3b 20 2a 71 20 21 |work].ou|tf; *q !|
|00005600| 3d 20 27 5c 6e 27 3b 20 | 71 2b 2b 29 20 3b 0a 58 |= '\n'; |q++) ;.X|
|00005610| 09 09 2a 71 20 3d 20 27 | 5c 30 27 3b 0a 58 09 09 |..*q = '|\0';.X..|
|00005620| 69 66 20 28 66 72 65 6f | 70 65 6e 28 77 6f 72 6b |if (freo|pen(work|
|00005630| 5b 74 68 69 73 77 6f 72 | 6b 5d 2e 6f 75 74 66 2c |[thiswor|k].outf,|
|00005640| 20 22 77 22 2c 20 73 74 | 64 6f 75 74 29 20 3d 3d | "w", st|dout) ==|
|00005650| 20 4e 55 4c 4c 29 20 7b | 0a 58 09 09 20 20 20 20 | NULL) {|.X.. |
|00005660| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|00005670| 22 6d 61 6b 65 77 6f 72 | 6b 3a 20 63 61 6e 6e 6f |"makewor|k: canno|
|00005680| 74 20 6f 70 65 6e 20 25 | 73 20 66 6f 72 20 73 74 |t open %|s for st|
|00005690| 64 20 6f 75 74 70 75 74 | 5c 6e 22 2c 0a 58 09 09 |d output|\n",.X..|
|000056a0| 09 77 6f 72 6b 5b 74 68 | 69 73 77 6f 72 6b 5d 2e |.work[th|iswork].|
|000056b0| 6f 75 74 66 29 3b 0a 58 | 09 09 20 20 20 20 66 66 |outf);.X|.. ff|
|000056c0| 6c 75 73 68 28 73 74 64 | 65 72 72 29 3b 0a 58 09 |lush(std|err);.X.|
|000056d0| 09 7d 0a 58 09 09 2a 71 | 20 3d 20 27 5c 6e 27 3b |.}.X..*q| = '\n';|
|000056e0| 0a 58 09 20 20 20 20 7d | 0a 58 09 20 20 20 20 65 |.X. }|.X. e|
|000056f0| 78 65 63 76 28 77 6f 72 | 6b 5b 74 68 69 73 77 6f |xecv(wor|k[thiswo|
|00005700| 72 6b 5d 2e 63 6d 64 2c | 20 77 6f 72 6b 5b 74 68 |rk].cmd,| work[th|
|00005710| 69 73 77 6f 72 6b 5d 2e | 61 76 29 3b 0a 58 09 20 |iswork].|av);.X. |
|00005720| 20 20 20 2f 2a 20 64 6f | 6e 27 74 20 65 78 70 65 | /* do|n't expe|
|00005730| 63 74 20 74 6f 20 67 65 | 74 20 68 65 72 65 21 20 |ct to ge|t here! |
|00005740| 2a 2f 0a 58 09 20 20 20 | 20 66 61 74 61 6c 28 22 |*/.X. | fatal("|
|00005750| 2a 2a 20 65 78 65 63 20 | 66 61 69 6c 65 64 20 2a |** exec |failed *|
|00005760| 2a 5c 6e 22 29 3b 0a 58 | 09 20 20 20 20 67 6f 74 |*\n");.X|. got|
|00005770| 6f 20 62 65 70 61 74 69 | 65 6e 74 3b 0a 58 09 7d |o bepati|ent;.X.}|
|00005780| 0a 58 09 65 6c 73 65 20 | 69 66 20 28 63 68 69 6c |.X.else |if (chil|
|00005790| 64 5b 69 5d 2e 70 69 64 | 20 3d 3d 20 2d 31 29 20 |d[i].pid| == -1) |
|000057a0| 7b 0a 58 09 20 20 20 20 | 66 61 74 61 6c 28 22 2a |{.X. |fatal("*|
|000057b0| 2a 20 66 6f 72 6b 20 66 | 61 69 6c 65 64 20 2a 2a |* fork f|ailed **|
|000057c0| 5c 6e 22 29 3b 0a 58 09 | 20 20 20 20 67 6f 74 6f |\n");.X.| goto|
|000057d0| 20 62 65 70 61 74 69 65 | 6e 74 3b 0a 58 09 7d 0a | bepatie|nt;.X.}.|
|000057e0| 58 09 65 6c 73 65 20 7b | 0a 58 09 20 20 20 20 63 |X.else {|.X. c|
|000057f0| 6c 6f 73 65 28 70 76 65 | 63 5b 30 5d 29 3b 0a 58 |lose(pve|c[0]);.X|
|00005800| 09 20 20 20 20 63 68 69 | 6c 64 5b 69 5d 2e 66 64 |. chi|ld[i].fd|
|00005810| 20 3d 20 70 76 65 63 5b | 31 5d 3b 0a 58 09 20 20 | = pvec[|1];.X. |
|00005820| 20 20 63 68 69 6c 64 5b | 69 5d 2e 6c 69 6e 65 20 | child[|i].line |
|00005830| 3d 20 63 68 69 6c 64 5b | 69 5d 2e 62 70 20 3d 20 |= child[|i].bp = |
|00005840| 77 6f 72 6b 5b 74 68 69 | 73 77 6f 72 6b 5d 2e 69 |work[thi|swork].i|
|00005850| 6e 70 75 74 3b 0a 58 09 | 20 20 20 20 63 68 69 6c |nput;.X.| chil|
|00005860| 64 5b 69 5d 2e 62 6c 65 | 6e 20 3d 20 77 6f 72 6b |d[i].ble|n = work|
|00005870| 5b 74 68 69 73 77 6f 72 | 6b 5d 2e 69 6e 70 73 69 |[thiswor|k].inpsi|
|00005880| 7a 65 3b 0a 58 09 20 20 | 20 20 63 68 69 6c 64 5b |ze;.X. | child[|
|00005890| 69 5d 2e 74 68 69 73 6a | 6f 62 20 3d 20 74 68 69 |i].thisj|ob = thi|
|000058a0| 73 77 6f 72 6b 3b 0a 58 | 09 20 20 20 20 63 68 69 |swork;.X|. chi|
|000058b0| 6c 64 5b 69 5d 2e 66 69 | 72 73 74 6a 6f 62 20 3d |ld[i].fi|rstjob =|
|000058c0| 20 74 68 69 73 77 6f 72 | 6b 3b 0a 58 09 20 20 20 | thiswor|k;.X. |
|000058d0| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|000058e0| 20 22 70 69 64 20 25 64 | 20 70 69 70 65 20 66 64 | "pid %d| pipe fd|
|000058f0| 20 25 64 22 2c 20 63 68 | 69 6c 64 5b 69 5d 2e 70 | %d", ch|ild[i].p|
|00005900| 69 64 2c 20 63 68 69 6c | 64 5b 69 5d 2e 66 64 29 |id, chil|d[i].fd)|
|00005910| 3b 0a 58 09 20 20 20 20 | 69 66 20 28 77 6f 72 6b |;.X. |if (work|
|00005920| 5b 74 68 69 73 77 6f 72 | 6b 5d 2e 6f 75 74 66 5b |[thiswor|k].outf[|
|00005930| 30 5d 20 21 3d 20 27 5c | 30 27 29 20 7b 0a 58 09 |0] != '\|0') {.X.|
|00005940| 09 63 68 61 72 20 2a 71 | 3b 0a 58 09 09 66 70 72 |.char *q|;.X..fpr|
|00005950| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 20 3e |intf(std|err, " >|
|00005960| 20 22 29 3b 0a 58 09 09 | 66 6f 72 20 28 71 3d 77 | ");.X..|for (q=w|
|00005970| 6f 72 6b 5b 74 68 69 73 | 77 6f 72 6b 5d 2e 6f 75 |ork[this|work].ou|
|00005980| 74 66 3b 20 2a 71 20 21 | 3d 20 27 5c 6e 27 3b 20 |tf; *q !|= '\n'; |
|00005990| 71 2b 2b 29 0a 58 09 09 | 20 20 20 20 66 70 75 74 |q++).X..| fput|
|000059a0| 63 28 2a 71 2c 20 73 74 | 64 65 72 72 29 3b 0a 58 |c(*q, st|derr);.X|
|000059b0| 09 20 20 20 20 7d 0a 58 | 09 20 20 20 20 66 70 75 |. }.X|. fpu|
|000059c0| 74 63 28 27 5c 6e 27 2c | 20 73 74 64 65 72 72 29 |tc('\n',| stderr)|
|000059d0| 3b 0a 58 09 20 20 20 20 | 74 68 69 73 77 6f 72 6b |;.X. |thiswork|
|000059e0| 2b 2b 3b 0a 58 09 20 20 | 20 20 69 66 20 28 74 68 |++;.X. | if (th|
|000059f0| 69 73 77 6f 72 6b 20 3e | 3d 20 6e 77 6f 72 6b 29 |iswork >|= nwork)|
|00005a00| 0a 58 09 09 74 68 69 73 | 77 6f 72 6b 20 3d 20 30 |.X..this|work = 0|
|00005a10| 3b 0a 58 09 7d 0a 58 20 | 20 20 20 7d 0a 58 20 20 |;.X.}.X | }.X |
|00005a20| 20 20 66 66 6c 75 73 68 | 28 73 74 64 65 72 72 29 | fflush|(stderr)|
|00005a30| 3b 0a 58 0a 58 20 20 20 | 20 73 72 61 6e 64 28 74 |;.X.X | srand(t|
|00005a40| 69 6d 65 28 30 29 29 3b | 0a 58 20 20 20 20 74 68 |ime(0));|.X th|
|00005a50| 72 65 73 20 3d 20 30 3b | 0a 58 20 20 20 20 64 6f |res = 0;|.X do|
|00005a60| 6e 65 20 3d 20 6f 75 74 | 70 75 74 20 3d 20 30 3b |ne = out|put = 0;|
|00005a70| 0a 58 20 20 20 20 66 6f | 72 20 28 69 20 3d 20 30 |.X fo|r (i = 0|
|00005a80| 3b 20 69 20 3c 20 6e 75 | 73 65 72 73 3b 20 69 2b |; i < nu|sers; i+|
|00005a90| 2b 29 20 7b 0a 58 09 69 | 66 20 28 63 68 69 6c 64 |+) {.X.i|f (child|
|00005aa0| 5b 69 5d 2e 62 6c 65 6e | 20 3d 3d 20 30 29 0a 58 |[i].blen| == 0).X|
|00005ab0| 09 20 20 20 20 64 6f 6e | 65 2b 2b 3b 0a 58 09 65 |. don|e++;.X.e|
|00005ac0| 6c 73 65 0a 58 09 20 20 | 20 20 74 68 72 65 73 20 |lse.X. | thres |
|00005ad0| 2b 3d 20 65 73 74 5f 72 | 61 74 65 20 2a 20 47 52 |+= est_r|ate * GR|
|00005ae0| 41 4e 55 4c 45 3b 0a 58 | 20 20 20 20 7d 0a 58 20 |ANULE;.X| }.X |
|00005af0| 20 20 20 65 73 74 5f 72 | 61 74 65 20 3d 20 74 68 | est_r|ate = th|
|00005b00| 72 65 73 3b 0a 58 0a 58 | 20 20 20 20 73 69 67 6e |res;.X.X| sign|
|00005b10| 61 6c 28 53 49 47 41 4c | 52 4d 2c 20 6f 6e 61 6c |al(SIGAL|RM, onal|
|00005b20| 61 72 6d 29 3b 0a 58 20 | 20 20 20 73 69 67 6e 61 |arm);.X | signa|
|00005b30| 6c 28 53 49 47 50 49 50 | 45 2c 20 70 69 70 65 65 |l(SIGPIP|E, pipee|
|00005b40| 72 72 29 3b 0a 58 20 20 | 20 20 61 6c 61 72 6d 28 |rr);.X | alarm(|
|00005b50| 47 52 41 4e 55 4c 45 29 | 3b 0a 58 20 20 20 20 77 |GRANULE)|;.X w|
|00005b60| 68 69 6c 65 20 28 64 6f | 6e 65 20 3c 20 6e 75 73 |hile (do|ne < nus|
|00005b70| 65 72 73 29 20 7b 0a 58 | 09 66 6f 72 20 28 69 20 |ers) {.X|.for (i |
|00005b80| 3d 20 30 3b 20 69 20 3c | 20 6e 75 73 65 72 73 3b |= 0; i <| nusers;|
|00005b90| 20 69 2b 2b 29 20 7b 0a | 58 09 20 20 20 20 63 70 | i++) {.|X. cp|
|00005ba0| 20 3d 20 26 63 68 69 6c | 64 5b 69 5d 3b 0a 58 09 | = &chil|d[i];.X.|
|00005bb0| 20 20 20 20 69 66 20 28 | 63 70 2d 3e 78 6d 69 74 | if (|cp->xmit|
|00005bc0| 20 3e 3d 20 63 70 2d 3e | 62 6c 65 6e 29 20 63 6f | >= cp->|blen) co|
|00005bd0| 6e 74 69 6e 75 65 3b 0a | 58 09 20 20 20 20 6c 20 |ntinue;.|X. l |
|00005be0| 3d 20 72 61 6e 64 28 29 | 20 25 20 43 48 55 4e 4b |= rand()| % CHUNK|
|00005bf0| 20 2b 20 31 3b 09 2f 2a | 20 31 2d 43 48 55 4e 4b | + 1;./*| 1-CHUNK|
|00005c00| 20 63 68 61 72 73 20 2a | 2f 0a 58 09 20 20 20 20 | chars *|/.X. |
|00005c10| 69 66 20 28 6c 20 3d 3d | 20 30 29 20 63 6f 6e 74 |if (l ==| 0) cont|
|00005c20| 69 6e 75 65 3b 0a 58 09 | 20 20 20 20 69 66 20 28 |inue;.X.| if (|
|00005c30| 63 70 2d 3e 78 6d 69 74 | 20 2b 20 6c 20 3e 20 63 |cp->xmit| + l > c|
|00005c40| 70 2d 3e 62 6c 65 6e 29 | 0a 58 09 09 6c 20 3d 20 |p->blen)|.X..l = |
|00005c50| 63 70 2d 3e 62 6c 65 6e | 20 2d 20 63 70 2d 3e 78 |cp->blen| - cp->x|
|00005c60| 6d 69 74 3b 0a 58 09 20 | 20 20 20 70 20 3d 20 63 |mit;.X. | p = c|
|00005c70| 70 2d 3e 62 70 3b 0a 58 | 09 20 20 20 20 63 70 2d |p->bp;.X|. cp-|
|00005c80| 3e 62 70 20 2b 3d 20 6c | 3b 0a 58 09 20 20 20 20 |>bp += l|;.X. |
|00005c90| 63 70 2d 3e 78 6d 69 74 | 20 2b 3d 20 6c 3b 0a 58 |cp->xmit| += l;.X|
|00005ca0| 23 69 66 20 64 65 62 75 | 67 0a 58 09 20 20 20 20 |#if debu|g.X. |
|00005cb0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|00005cc0| 22 63 68 69 6c 64 20 25 | 64 2c 20 25 64 20 70 72 |"child %|d, %d pr|
|00005cd0| 6f 63 65 73 73 65 64 2c | 20 25 64 20 74 6f 20 67 |ocessed,| %d to g|
|00005ce0| 6f 5c 6e 22 2c 20 69 2c | 20 63 70 2d 3e 78 6d 69 |o\n", i,| cp->xmi|
|00005cf0| 74 2c 20 63 70 2d 3e 62 | 6c 65 6e 20 2d 20 63 70 |t, cp->b|len - cp|
|00005d00| 2d 3e 78 6d 69 74 29 3b | 0a 58 23 65 6e 64 69 66 |->xmit);|.X#endif|
|00005d10| 0a 58 09 20 20 20 20 77 | 68 69 6c 65 20 28 70 20 |.X. w|hile (p |
|00005d20| 3c 20 63 70 2d 3e 62 70 | 29 20 7b 0a 58 09 09 69 |< cp->bp|) {.X..i|
|00005d30| 66 20 28 2a 70 20 3d 3d | 20 27 5c 6e 27 20 7c 7c |f (*p ==| '\n' |||
|00005d40| 20 28 70 20 3d 3d 20 26 | 63 70 2d 3e 62 70 5b 2d | (p == &|cp->bp[-|
|00005d50| 31 5d 20 26 26 20 63 70 | 2d 3e 78 6d 69 74 20 3e |1] && cp|->xmit >|
|00005d60| 3d 20 63 70 2d 3e 62 6c | 65 6e 29 29 20 7b 0a 58 |= cp->bl|en)) {.X|
|00005d70| 09 09 20 20 20 20 2f 2a | 20 77 72 69 74 65 20 69 |.. /*| write i|
|00005d80| 74 20 6f 75 74 20 2a 2f | 0a 58 09 09 20 20 20 20 |t out */|.X.. |
|00005d90| 6e 63 68 20 3d 20 70 20 | 2d 20 63 70 2d 3e 6c 69 |nch = p |- cp->li|
|00005da0| 6e 65 20 2b 20 31 3b 0a | 58 09 09 20 20 20 20 69 |ne + 1;.|X.. i|
|00005db0| 66 20 28 28 77 72 69 74 | 74 65 6e 20 3d 20 77 72 |f ((writ|ten = wr|
|00005dc0| 69 74 65 28 63 70 2d 3e | 66 64 2c 20 63 70 2d 3e |ite(cp->|fd, cp->|
|00005dd0| 6c 69 6e 65 2c 20 6e 63 | 68 29 29 20 21 3d 20 6e |line, nc|h)) != n|
|00005de0| 63 68 29 20 7b 0a 58 09 | 09 09 2f 2a 20 61 72 67 |ch) {.X.|../* arg|
|00005df0| 68 21 20 2a 2f 0a 58 09 | 09 09 63 70 2d 3e 6c 69 |h! */.X.|..cp->li|
|00005e00| 6e 65 5b 6e 63 68 5d 20 | 3d 20 27 5c 30 27 3b 0a |ne[nch] |= '\0';.|
|00005e10| 58 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 |X...fpri|ntf(stde|
|00005e20| 72 72 2c 20 22 75 73 65 | 72 20 25 64 20 6a 6f 62 |rr, "use|r %d job|
|00005e30| 20 25 64 20 63 6d 64 20 | 25 73 20 22 2c 0a 58 09 | %d cmd |%s ",.X.|
|00005e40| 09 09 09 66 69 72 73 74 | 75 73 65 72 2b 69 2c 20 |...first|user+i, |
|00005e50| 63 70 2d 3e 74 68 69 73 | 6a 6f 62 2c 20 63 70 2d |cp->this|job, cp-|
|00005e60| 3e 6c 69 6e 65 29 3b 0a | 58 20 09 09 09 66 70 72 |>line);.|X ...fpr|
|00005e70| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 77 72 |intf(std|err, "wr|
|00005e80| 69 74 65 28 2c 2c 25 64 | 29 20 72 65 74 75 72 6e |ite(,,%d|) return|
|00005e90| 73 20 25 64 5c 6e 22 2c | 20 6e 63 68 2c 20 77 72 |s %d\n",| nch, wr|
|00005ea0| 69 74 74 65 6e 29 3b 0a | 58 09 09 09 69 66 20 28 |itten);.|X...if (|
|00005eb0| 73 69 67 70 69 70 65 29 | 0a 58 09 09 09 20 20 20 |sigpipe)|.X... |
|00005ec0| 20 66 61 74 61 6c 28 22 | 2a 2a 20 53 49 47 50 49 | fatal("|** SIGPI|
|00005ed0| 50 45 20 65 72 72 6f 72 | 20 2a 2a 5c 6e 22 29 3b |PE error| **\n");|
|00005ee0| 0a 58 09 09 09 65 6c 73 | 65 0a 58 09 09 09 20 20 |.X...els|e.X... |
|00005ef0| 20 20 66 61 74 61 6c 28 | 22 2a 2a 20 77 72 69 74 | fatal(|"** writ|
|00005f00| 65 20 65 72 72 6f 72 20 | 2a 2a 5c 6e 22 29 3b 0a |e error |**\n");.|
|00005f10| 58 09 09 09 67 6f 74 6f | 20 62 65 70 61 74 69 65 |X...goto| bepatie|
|00005f20| 6e 74 3b 0a 58 0a 58 09 | 09 20 20 20 20 7d 0a 58 |nt;.X.X.|. }.X|
|00005f30| 09 09 20 20 20 20 69 66 | 20 28 66 63 6f 70 79 29 |.. if| (fcopy)|
|00005f40| 0a 58 09 09 09 77 72 69 | 74 65 28 66 63 6f 70 79 |.X...wri|te(fcopy|
|00005f50| 2c 20 63 70 2d 3e 6c 69 | 6e 65 2c 20 70 20 2d 20 |, cp->li|ne, p - |
|00005f60| 63 70 2d 3e 6c 69 6e 65 | 20 2b 20 31 29 3b 0a 58 |cp->line| + 1);.X|
|00005f70| 23 69 66 20 64 65 62 75 | 67 0a 58 09 09 20 20 20 |#if debu|g.X.. |
|00005f80| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|00005f90| 20 22 63 68 69 6c 64 20 | 25 64 20 67 65 74 73 20 | "child |%d gets |
|00005fa0| 5c 22 22 2c 20 69 29 3b | 0a 58 09 09 20 20 20 20 |\"", i);|.X.. |
|00005fb0| 7b 0a 58 09 09 09 63 68 | 61 72 20 2a 71 20 3d 20 |{.X...ch|ar *q = |
|00005fc0| 63 70 2d 3e 6c 69 6e 65 | 3b 0a 58 09 09 09 77 68 |cp->line|;.X...wh|
|00005fd0| 69 6c 65 20 28 71 20 3c | 3d 20 70 29 20 7b 0a 58 |ile (q <|= p) {.X|
|00005fe0| 09 09 09 09 69 66 20 28 | 2a 71 20 3e 3d 20 27 20 |....if (|*q >= ' |
|00005ff0| 27 20 26 26 20 2a 71 20 | 3c 3d 20 27 7e 27 29 0a |' && *q |<= '~').|
|00006000| 58 09 09 09 09 09 66 70 | 75 74 63 28 2a 71 2c 20 |X.....fp|utc(*q, |
|00006010| 73 74 64 65 72 72 29 3b | 0a 58 09 09 09 09 65 6c |stderr);|.X....el|
|00006020| 73 65 0a 58 09 09 09 09 | 09 66 70 72 69 6e 74 66 |se.X....|.fprintf|
|00006030| 28 73 74 64 65 72 72 2c | 20 22 5c 5c 25 30 33 6f |(stderr,| "\\%03o|
|00006040| 22 2c 20 2a 71 29 3b 0a | 58 09 09 09 09 71 2b 2b |", *q);.|X....q++|
|00006050| 3b 0a 58 09 09 09 7d 0a | 58 09 09 20 20 20 20 7d |;.X...}.|X.. }|
|00006060| 0a 58 09 09 20 20 20 20 | 66 70 75 74 63 28 27 22 |.X.. |fputc('"|
|00006070| 27 2c 20 73 74 64 65 72 | 72 29 3b 0a 58 23 65 6e |', stder|r);.X#en|
|00006080| 64 69 66 0a 58 09 09 20 | 20 20 20 63 70 2d 3e 6c |dif.X.. | cp->l|
|00006090| 69 6e 65 20 3d 20 26 70 | 5b 31 5d 3b 0a 58 09 09 |ine = &p|[1];.X..|
|000060a0| 7d 0a 58 09 09 70 2b 2b | 3b 0a 58 09 20 20 20 20 |}.X..p++|;.X. |
|000060b0| 7d 0a 58 09 20 20 20 20 | 69 66 20 28 63 70 2d 3e |}.X. |if (cp->|
|000060c0| 78 6d 69 74 20 3e 3d 20 | 63 70 2d 3e 62 6c 65 6e |xmit >= |cp->blen|
|000060d0| 29 20 7b 0a 58 09 09 64 | 6f 6e 65 2b 2b 3b 0a 58 |) {.X..d|one++;.X|
|000060e0| 09 09 63 6c 6f 73 65 28 | 63 70 2d 3e 66 64 29 3b |..close(|cp->fd);|
|000060f0| 0a 58 23 69 66 20 64 65 | 62 75 67 0a 58 09 66 70 |.X#if de|bug.X.fp|
|00006100| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 63 |rintf(st|derr, "c|
|00006110| 68 69 6c 64 20 25 64 2c | 20 63 6c 6f 73 65 20 73 |hild %d,| close s|
|00006120| 74 64 20 69 6e 70 75 74 | 5c 6e 22 2c 20 69 29 3b |td input|\n", i);|
|00006130| 0a 58 23 65 6e 64 69 66 | 0a 58 09 20 20 20 20 7d |.X#endif|.X. }|
|00006140| 0a 58 09 20 20 20 20 6f | 75 74 70 75 74 20 2b 3d |.X. o|utput +=|
|00006150| 20 6c 3b 0a 58 09 7d 0a | 58 09 77 68 69 6c 65 20 | l;.X.}.|X.while |
|00006160| 28 6f 75 74 70 75 74 20 | 3e 20 74 68 72 65 73 29 |(output |> thres)|
|00006170| 20 7b 0a 58 09 20 20 20 | 20 70 61 75 73 65 28 29 | {.X. | pause()|
|00006180| 3b 0a 58 23 69 66 20 64 | 65 62 75 67 0a 58 09 20 |;.X#if d|ebug.X. |
|00006190| 20 20 20 66 70 72 69 6e | 74 66 28 73 74 64 65 72 | fprin|tf(stder|
|000061a0| 72 2c 20 22 61 66 74 65 | 72 20 70 61 75 73 65 3a |r, "afte|r pause:|
|000061b0| 20 6f 75 74 70 75 74 2c | 20 74 68 72 65 73 2c 20 | output,| thres, |
|000061c0| 64 6f 6e 65 20 25 64 20 | 25 2e 32 66 20 25 64 5c |done %d |%.2f %d\|
|000061d0| 6e 22 2c 20 6f 75 74 70 | 75 74 2c 20 74 68 72 65 |n", outp|ut, thre|
|000061e0| 73 2c 20 64 6f 6e 65 29 | 3b 0a 58 23 65 6e 64 69 |s, done)|;.X#endi|
|000061f0| 66 0a 58 09 7d 0a 58 20 | 20 20 20 7d 0a 58 0a 58 |f.X.}.X | }.X.X|
|00006200| 62 65 70 61 74 69 65 6e | 74 3a 0a 58 20 20 20 20 |bepatien|t:.X |
|00006210| 61 6c 61 72 6d 28 30 29 | 3b 0a 58 2f 2a 2a 2a 2a |alarm(0)|;.X/****|
|00006220| 0a 58 20 2a 20 20 49 66 | 20 65 76 65 72 79 74 68 |.X * If| everyth|
|00006230| 69 6e 67 20 69 73 20 67 | 6f 69 6e 67 20 4f 4b 2c |ing is g|oing OK,|
|00006240| 20 77 65 20 73 68 6f 75 | 6c 64 20 73 69 6d 70 6c | we shou|ld simpl|
|00006250| 79 20 62 65 20 61 62 6c | 65 20 74 6f 20 6b 65 65 |y be abl|e to kee|
|00006260| 70 0a 58 20 2a 20 20 6c | 6f 6f 70 69 6e 67 20 75 |p.X * l|ooping u|
|00006270| 6e 69 74 69 6c 20 27 77 | 61 69 74 27 20 66 61 69 |nitil 'w|ait' fai|
|00006280| 6c 73 2c 20 68 6f 77 65 | 76 65 72 20 73 6f 6d 65 |ls, howe|ver some|
|00006290| 20 64 65 73 63 65 6e 64 | 65 6e 74 20 70 72 6f 63 | descend|ent proc|
|000062a0| 65 73 73 20 6d 61 79 0a | 58 20 2a 20 20 62 65 20 |ess may.|X * be |
|000062b0| 69 6e 20 61 20 73 74 61 | 74 65 20 66 72 6f 6d 20 |in a sta|te from |
|000062c0| 77 68 69 63 68 20 69 74 | 20 63 61 6e 20 6e 65 76 |which it| can nev|
|000062d0| 65 72 20 65 78 69 74 2c | 20 61 6e 64 20 73 6f 20 |er exit,| and so |
|000062e0| 61 20 74 69 6d 65 6f 75 | 74 0a 58 20 2a 20 20 69 |a timeou|t.X * i|
|000062f0| 73 20 75 73 65 64 2e 0a | 58 20 2a 20 20 35 20 6d |s used..|X * 5 m|
|00006300| 69 6e 75 74 65 73 20 73 | 68 6f 75 6c 64 20 62 65 |inutes s|hould be|
|00006310| 20 61 6d 70 6c 65 2c 20 | 73 69 6e 63 65 20 74 68 | ample, |since th|
|00006320| 65 20 74 69 6d 65 20 74 | 6f 20 72 75 6e 20 61 6c |e time t|o run al|
|00006330| 6c 20 6a 6f 62 73 20 69 | 73 20 6f 66 0a 58 20 2a |l jobs i|s of.X *|
|00006340| 20 20 74 68 65 20 6f 72 | 64 65 72 20 6f 66 20 35 | the or|der of 5|
|00006350| 2d 31 30 20 6d 69 6e 75 | 74 65 73 2c 20 68 6f 77 |-10 minu|tes, how|
|00006360| 65 76 65 72 20 73 6f 6d | 65 20 6d 61 63 68 69 6e |ever som|e machin|
|00006370| 65 73 20 61 72 65 20 70 | 61 69 6e 66 75 6c 6c 79 |es are p|ainfully|
|00006380| 20 73 6c 6f 77 2c 0a 58 | 20 2a 20 20 73 6f 20 74 | slow,.X| * so t|
|00006390| 68 65 20 74 69 6d 65 6f | 75 74 20 68 61 73 20 62 |he timeo|ut has b|
|000063a0| 65 65 6e 20 73 65 74 20 | 61 74 20 32 30 20 6d 69 |een set |at 20 mi|
|000063b0| 6e 75 74 65 73 20 28 31 | 32 30 30 20 73 65 63 6f |nutes (1|200 seco|
|000063c0| 6e 64 73 29 2e 0a 58 20 | 2a 2a 2a 2a 2f 0a 58 20 |nds)..X |****/.X |
|000063d0| 20 20 20 73 69 67 6e 61 | 6c 28 53 49 47 41 4c 52 | signa|l(SIGALR|
|000063e0| 4d 2c 20 67 72 75 6e 74 | 29 3b 0a 58 20 20 20 20 |M, grunt|);.X |
|000063f0| 61 6c 61 72 6d 28 31 32 | 30 30 29 3b 0a 58 20 20 |alarm(12|00);.X |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.