home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / MAILBOX.ZIP / BYTEQRY.TEX < prev    next >
LaTeX Document  |  1988-03-28  |  7.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: BYTEQRY.TEX

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CRLF line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CRLF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 64 6f 63 75 6d 65 6e | 74 73 74 79 6c 65 7b 61 |\documen|tstyle{a|
|00000010| 72 74 69 63 6c 65 7d 0d | 0a 0d 0a 5c 62 65 67 69 |rticle}.|...\begi|
|00000020| 6e 7b 64 6f 63 75 6d 65 | 6e 74 7d 0d 0a 0d 0a 5c |n{docume|nt}....\|
|00000030| 62 65 67 69 6e 7b 66 6c | 75 73 68 72 69 67 68 74 |begin{fl|ushright|
|00000040| 7d 0d 0a 4d 69 63 68 61 | 65 6c 20 42 2e 20 50 61 |}..Micha|el B. Pa|
|00000050| 72 6b 65 72 2c 20 4d 49 | 54 20 27 38 39 20 5c 5c |rker, MI|T '89 \\|
|00000060| 0d 0a 7c 5c 5c 0d 0a 45 | 61 73 74 20 43 61 6d 70 |..|\\..E|ast Camp|
|00000070| 75 73 20 2d 20 4d 75 6e | 2e 20 33 30 33 20 5c 5c |us - Mun|. 303 \\|
|00000080| 0d 0a 33 20 41 6d 65 73 | 20 53 74 72 65 65 74 20 |..3 Ames| Street |
|00000090| 5c 5c 0d 0a 43 61 6d 62 | 72 69 64 67 65 2c 20 4d |\\..Camb|ridge, M|
|000000a0| 41 20 30 32 31 33 39 20 | 5c 5c 0d 0a 28 36 31 37 |A 02139 |\\..(617|
|000000b0| 29 20 32 32 35 2d 36 33 | 30 33 0d 0a 0d 0a 5c 6d |) 225-63|03....\m|
|000000c0| 65 64 73 6b 69 70 0d 0a | 0d 0a 31 30 20 44 65 63 |edskip..|..10 Dec|
|000000d0| 65 6d 62 65 72 20 31 39 | 38 37 0d 0a 5c 65 6e 64 |ember 19|87..\end|
|000000e0| 7b 66 6c 75 73 68 72 69 | 67 68 74 7d 0d 0a 0d 0a |{flushri|ght}....|
|000000f0| 5c 62 65 67 69 6e 7b 66 | 6c 75 73 68 6c 65 66 74 |\begin{f|lushleft|
|00000100| 7d 0d 0a 4d 72 2e 20 4b | 65 6e 20 53 68 65 6c 64 |}..Mr. K|en Sheld|
|00000110| 6f 6e 5c 5c 0d 0a 7c 5c | 5c 0d 0a 42 79 74 65 20 |on\\..|\|\..Byte |
|00000120| 4d 61 67 61 7a 69 6e 65 | 20 5c 5c 0d 0a 37 30 20 |Magazine| \\..70 |
|00000130| 4d 61 69 6e 20 53 74 72 | 65 65 74 5c 5c 0d 0a 50 |Main Str|eet\\..P|
|00000140| 65 74 65 72 62 6f 72 6f | 75 67 68 2c 20 4e 48 20 |eterboro|ugh, NH |
|00000150| 30 33 34 35 38 5c 5c 0d | 0a 28 36 30 33 29 20 39 |03458\\.|.(603) 9|
|00000160| 32 34 2d 39 32 38 31 5c | 5c 0d 0a 5c 62 69 67 73 |24-9281\|\..\bigs|
|00000170| 6b 69 70 0d 0a 44 65 61 | 72 20 4d 72 2e 20 57 69 |kip..Dea|r Mr. Wi|
|00000180| 6c 6c 69 61 6d 73 2c 5c | 5c 0d 0a 5c 62 69 67 73 |lliams,\|\..\bigs|
|00000190| 6b 69 70 0d 0a 5c 65 6e | 64 7b 66 6c 75 73 68 6c |kip..\en|d{flushl|
|000001a0| 65 66 74 7d 0d 0a 0d 0a | 54 6f 20 61 64 64 72 65 |eft}....|To addre|
|000001b0| 73 73 20 74 68 65 20 70 | 72 6f 62 6c 65 6d 73 20 |ss the p|roblems |
|000001c0| 6f 66 20 6d 75 6c 74 69 | 74 61 73 6b 69 6e 67 20 |of multi|tasking |
|000001d0| 75 6e 64 65 72 73 74 61 | 6e 64 69 6e 67 20 61 6e |understa|nding an|
|000001e0| 64 20 70 6f 72 74 61 62 | 69 6c 69 74 79 0d 0a 77 |d portab|ility..w|
|000001f0| 69 74 68 69 6e 20 74 68 | 65 20 73 6d 61 6c 6c 20 |ithin th|e small |
|00000200| 73 79 73 74 65 6d 73 20 | 77 6f 72 6c 64 2c 20 49 |systems |world, I|
|00000210| 20 70 72 6f 70 6f 73 65 | 20 61 20 73 65 72 69 65 | propose| a serie|
|00000220| 73 20 6f 66 20 74 68 72 | 65 65 20 73 68 6f 72 74 |s of thr|ee short|
|00000230| 20 61 72 74 69 63 6c 65 | 73 0d 0a 69 6e 20 77 68 | article|s..in wh|
|00000240| 69 63 68 20 7b 5c 65 6d | 20 74 68 65 20 72 65 61 |ich {\em| the rea|
|00000250| 64 65 72 20 61 63 74 75 | 61 6c 6c 79 20 62 75 69 |der actu|ally bui|
|00000260| 6c 64 73 20 68 69 73 20 | 6f 72 20 68 65 72 20 6f |lds his |or her o|
|00000270| 77 6e 20 70 6f 72 74 61 | 62 6c 65 0d 0a 6d 75 6c |wn porta|ble..mul|
|00000280| 74 69 74 61 73 6b 69 6e | 67 20 65 6e 76 69 72 6f |titaskin|g enviro|
|00000290| 6e 6d 65 6e 74 7d 2e 0d | 0a 0d 0a 54 68 65 20 61 |nment}..|...The a|
|000002a0| 72 74 69 63 6c 65 73 2c | 20 65 61 63 68 20 77 68 |rticles,| each wh|
|000002b0| 69 63 68 20 63 6f 75 6c | 64 20 73 74 61 6e 64 20 |ich coul|d stand |
|000002c0| 61 6c 6f 6e 65 2c 20 77 | 69 6c 6c 20 61 64 64 72 |alone, w|ill addr|
|000002d0| 65 73 73 20 74 77 6f 0d | 0a 69 6d 70 6f 72 74 61 |ess two.|.importa|
|000002e0| 6e 74 20 6e 65 65 64 73 | 20 6f 66 20 74 68 65 20 |nt needs| of the |
|000002f0| 6d 69 6e 69 2d 20 61 6e | 64 20 6d 69 63 72 6f 2d |mini- an|d micro-|
|00000300| 63 6f 6d 70 75 74 65 72 | 20 77 6f 72 6c 64 3a 0d |computer| world:.|
|00000310| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 64 65 73 63 72 69 |...\begi|n{descri|
|00000320| 70 74 69 6f 6e 7d 0d 0a | 0d 0a 09 5c 69 74 65 6d |ption}..|...\item|
|00000330| 5b 55 6e 64 65 72 73 74 | 61 6e 64 69 6e 67 20 4e |[Underst|anding N|
|00000340| 65 65 64 3a 5d 20 46 69 | 72 73 74 2c 20 6d 69 6e |eed:] Fi|rst, min|
|00000350| 69 2d 20 61 6e 64 20 6d | 69 63 72 6f 2d 63 6f 6d |i- and m|icro-com|
|00000360| 70 75 74 65 72 0d 0a 75 | 73 65 72 73 20 61 72 65 |puter..u|sers are|
|00000370| 20 6e 6f 77 20 72 65 61 | 6c 69 7a 69 6e 67 20 74 | now rea|lizing t|
|00000380| 68 65 20 62 65 6e 65 66 | 69 74 73 20 6f 66 20 6d |he benef|its of m|
|00000390| 75 6c 74 69 74 61 73 6b | 69 6e 67 20 74 68 65 69 |ultitask|ing thei|
|000003a0| 72 20 73 79 73 74 65 6d | 73 20 61 6e 64 0d 0a 61 |r system|s and..a|
|000003b0| 72 65 20 62 65 63 6f 6d | 69 6e 67 20 69 6e 63 72 |re becom|ing incr|
|000003c0| 65 61 73 69 6e 67 6c 79 | 20 69 6e 74 65 72 65 73 |easingly| interes|
|000003d0| 74 65 64 2e 20 20 46 6f | 72 20 79 65 61 72 73 2c |ted. Fo|r years,|
|000003e0| 20 75 73 65 72 73 20 68 | 61 76 65 20 77 61 6e 74 | users h|ave want|
|000003f0| 65 64 0d 0a 6d 75 6c 74 | 69 74 61 73 6b 69 6e 67 |ed..mult|itasking|
|00000400| 20 62 75 74 20 6e 6f 74 | 20 75 6e 64 65 72 73 74 | but not| underst|
|00000410| 6f 6f 64 20 69 74 2e 20 | 20 50 72 6f 67 72 61 6d |ood it. | Program|
|00000420| 6d 65 72 73 20 68 61 76 | 65 20 6e 65 65 64 65 64 |mers hav|e needed|
|00000430| 20 69 74 20 62 75 74 0d | 0a 6e 6f 74 20 6b 6e 6f | it but.|.not kno|
|00000440| 77 6e 20 68 6f 77 20 74 | 6f 20 69 6d 70 6c 65 6d |wn how t|o implem|
|00000450| 65 6e 74 20 69 74 2e 20 | 20 54 68 65 20 60 60 70 |ent it. | The ``p|
|00000460| 6f 70 2d 75 70 27 27 20 | 73 6f 66 74 77 61 72 65 |op-up'' |software|
|00000470| 20 61 6e 64 0d 0a 60 60 | 61 70 70 6c 69 63 61 74 | and..``|applicat|
|00000480| 69 6f 6e 2d 69 6e 74 65 | 67 72 61 74 6f 72 73 27 |ion-inte|grators'|
|00000490| 27 20 66 6f 75 6e 64 20 | 6f 6e 20 74 68 65 20 4d |' found |on the M|
|000004a0| 61 63 69 6e 74 6f 73 68 | 20 61 6e 64 20 49 42 4d |acintosh| and IBM|
|000004b0| 20 50 43 20 69 6e 64 69 | 63 61 74 65 0d 0a 74 68 | PC indi|cate..th|
|000004c0| 65 20 6e 65 65 64 20 66 | 6f 72 20 6d 75 6c 74 69 |e need f|or multi|
|000004d0| 74 61 73 6b 69 6e 67 20 | 62 75 74 20 68 61 76 65 |tasking |but have|
|000004e0| 20 6e 6f 74 20 66 75 6c | 6c 79 20 73 61 74 69 73 | not ful|ly satis|
|000004f0| 66 69 65 64 20 74 68 61 | 74 20 6e 65 65 64 2e 0d |fied tha|t need..|
|00000500| 0a 52 65 61 6c 20 61 6e | 64 20 65 66 66 65 63 74 |.Real an|d effect|
|00000510| 69 76 65 20 6d 75 6c 74 | 69 74 61 73 6b 69 6e 67 |ive mult|itasking|
|00000520| 20 69 6e 76 6f 6c 76 65 | 73 20 74 72 69 63 6b 79 | involve|s tricky|
|00000530| 20 73 79 6e 63 68 72 6f | 6e 69 7a 61 74 69 6f 6e | synchro|nization|
|00000540| 20 61 6e 64 0d 0a 63 6f | 64 69 6e 67 20 69 73 73 | and..co|ding iss|
|00000550| 75 65 73 20 6e 6f 74 20 | 63 6f 6d 6d 6f 6e 6c 79 |ues not |commonly|
|00000560| 20 75 6e 64 65 72 73 74 | 6f 6f 64 20 69 6e 20 74 | underst|ood in t|
|00000570| 68 65 20 73 6d 61 6c 6c | 20 73 79 73 74 65 6d 73 |he small| systems|
|00000580| 20 77 6f 72 6c 64 2e 0d | 0a 4f 6e 6c 79 20 72 65 | world..|.Only re|
|00000590| 63 65 6e 74 6c 79 20 61 | 72 65 20 6f 70 65 72 61 |cently a|re opera|
|000005a0| 74 69 6e 67 20 73 79 73 | 74 65 6d 73 20 62 65 67 |ting sys|tems beg|
|000005b0| 69 6e 6e 69 6e 67 20 74 | 6f 20 61 70 70 65 61 72 |inning t|o appear|
|000005c0| 20 28 41 70 70 6c 65 0d | 0a 4d 75 6c 74 69 46 69 | (Apple.|.MultiFi|
|000005d0| 6e 64 65 72 2c 20 4d 69 | 63 72 6f 73 6f 66 74 20 |nder, Mi|crosoft |
|000005e0| 4f 53 2f 32 29 20 77 68 | 69 63 68 20 70 72 6f 76 |OS/2) wh|ich prov|
|000005f0| 69 64 65 20 6d 75 6c 74 | 69 74 61 73 6b 69 6e 67 |ide mult|itasking|
|00000600| 20 73 75 70 70 6f 72 74 | 2e 20 20 41 6e 64 0d 0a | support|. And..|
|00000610| 61 73 20 75 73 65 72 73 | 20 62 65 67 69 6e 20 74 |as users| begin t|
|00000620| 6f 20 61 70 70 72 65 63 | 69 61 74 65 20 74 68 65 |o apprec|iate the|
|00000630| 6d 2c 20 49 20 73 70 65 | 63 75 6c 61 74 65 20 7b |m, I spe|culate {|
|00000640| 5c 65 6d 20 61 20 67 72 | 6f 77 69 6e 67 20 6e 65 |\em a gr|owing ne|
|00000650| 65 64 20 74 6f 0d 0a 6b | 6e 6f 77 20 68 6f 77 20 |ed to..k|now how |
|00000660| 74 6f 20 6f 70 65 72 61 | 74 65 20 61 6e 64 20 70 |to opera|te and p|
|00000670| 72 6f 67 72 61 6d 20 77 | 69 74 68 69 6e 20 61 20 |rogram w|ithin a |
|00000680| 6d 75 6c 74 69 74 61 73 | 6b 69 6e 67 20 65 6e 76 |multitas|king env|
|00000690| 69 72 6f 6e 6d 65 6e 74 | 2e 7d 0d 0a 0d 0a 09 5c |ironment|.}.....\|
|000006a0| 69 74 65 6d 5b 50 6f 72 | 74 61 62 69 6c 69 74 79 |item[Por|tability|
|000006b0| 20 4e 65 65 64 3a 5d 20 | 53 65 63 6f 6e 64 2c 20 | Need:] |Second, |
|000006c0| 74 68 65 20 66 65 77 20 | 6d 75 6c 74 69 74 61 73 |the few |multitas|
|000006d0| 6b 69 6e 67 0d 0a 65 6e | 76 69 72 6f 6e 6d 65 6e |king..en|vironmen|
|000006e0| 74 73 20 77 68 69 63 68 | 20 64 6f 20 65 78 69 73 |ts which| do exis|
|000006f0| 74 20 6f 6e 20 73 6d 61 | 6c 6c 20 73 79 73 74 65 |t on sma|ll syste|
|00000700| 6d 73 20 61 72 65 20 6f | 66 74 65 6e 20 76 65 72 |ms are o|ften ver|
|00000710| 79 20 63 6f 6d 70 6c 65 | 78 3b 0d 0a 77 6f 72 73 |y comple|x;..wors|
|00000720| 65 2c 20 74 68 65 79 20 | 61 6c 73 6f 20 64 65 6d |e, they |also dem|
|00000730| 61 6e 64 20 73 70 65 63 | 69 61 6c 20 68 61 72 64 |and spec|ial hard|
|00000740| 77 61 72 65 20 77 68 69 | 63 68 20 6c 69 6d 69 74 |ware whi|ch limit|
|00000750| 20 74 68 65 20 70 6f 72 | 74 61 62 69 6c 69 74 79 | the por|tability|
|00000760| 20 6f 66 0d 0a 74 68 65 | 69 72 20 61 70 70 6c 69 | of..the|ir appli|
|00000770| 63 61 74 69 6f 6e 73 2e | 20 20 54 6f 20 62 65 20 |cations.| To be |
|00000780| 66 6c 65 78 69 62 6c 65 | 20 61 6e 64 20 65 66 66 |flexible| and eff|
|00000790| 69 63 69 65 6e 74 2c 20 | 73 6f 70 68 69 73 74 69 |icient, |sophisti|
|000007a0| 63 61 74 65 64 0d 0a 61 | 70 70 6c 69 63 61 74 69 |cated..a|pplicati|
|000007b0| 6f 6e 73 20 72 65 71 75 | 69 72 65 20 6d 75 6c 74 |ons requ|ire mult|
|000007c0| 69 70 6c 65 20 74 61 73 | 6b 73 3b 20 79 65 74 2c |iple tas|ks; yet,|
|000007d0| 20 62 65 63 61 75 73 65 | 20 6f 66 20 74 68 65 20 | because| of the |
|000007e0| 70 6f 6f 72 0d 0a 6d 75 | 6c 74 69 74 61 73 6b 69 |poor..mu|ltitaski|
|000007f0| 6e 67 20 63 6f 6e 73 74 | 72 75 63 74 73 20 61 76 |ng const|ructs av|
|00000800| 61 69 6c 61 62 6c 65 2c | 20 74 68 65 79 20 71 75 |ailable,| they qu|
|00000810| 69 63 6b 6c 79 20 62 65 | 63 6f 6d 65 20 62 6f 75 |ickly be|come bou|
|00000820| 6e 64 20 74 6f 20 74 68 | 65 0d 0a 6f 70 65 72 61 |nd to th|e..opera|
|00000830| 74 69 6e 67 20 73 79 73 | 74 65 6d 20 61 6e 64 20 |ting sys|tem and |
|00000840| 74 68 65 20 6d 61 63 68 | 69 6e 65 20 6f 6e 20 77 |the mach|ine on w|
|00000850| 68 69 63 68 20 74 68 65 | 79 20 77 65 72 65 20 77 |hich the|y were w|
|00000860| 72 69 74 74 65 6e 2e 20 | 20 53 6f 20 61 73 20 75 |ritten. | So as u|
|00000870| 73 65 72 73 0d 0a 62 65 | 67 69 6e 20 74 61 6b 69 |sers..be|gin taki|
|00000880| 6e 67 20 61 64 76 61 6e | 74 61 67 65 20 6f 66 20 |ng advan|tage of |
|00000890| 6d 75 6c 74 69 74 61 73 | 6b 69 6e 67 2c 20 49 20 |multitas|king, I |
|000008a0| 73 70 65 63 75 6c 61 74 | 65 20 7b 5c 65 6d 20 61 |speculat|e {\em a|
|000008b0| 20 67 72 6f 77 69 6e 67 | 20 6e 65 65 64 0d 0a 66 | growing| need..f|
|000008c0| 6f 72 20 70 6f 72 74 61 | 62 69 6c 69 74 79 20 61 |or porta|bility a|
|000008d0| 6e 64 20 73 74 61 6e 64 | 61 72 64 20 6d 75 6c 74 |nd stand|ard mult|
|000008e0| 69 74 61 73 6b 69 6e 67 | 20 63 6f 6e 73 74 72 75 |itasking| constru|
|000008f0| 63 74 73 2e 7d 0d 0a 0d | 0a 5c 65 6e 64 7b 64 65 |cts.}...|.\end{de|
|00000900| 73 63 72 69 70 74 69 6f | 6e 7d 0d 0a 0d 0a 4d 79 |scriptio|n}....My|
|00000910| 20 73 65 72 69 65 73 2c | 20 74 68 65 6e 2c 20 77 | series,| then, w|
|00000920| 69 6c 6c 20 7b 5c 62 66 | 20 65 78 70 6c 61 69 6e |ill {\bf| explain|
|00000930| 7d 20 74 68 65 20 70 72 | 6f 67 72 61 6d 6d 69 6e |} the pr|ogrammin|
|00000940| 67 20 63 6f 6e 63 65 70 | 74 73 20 61 6e 64 0d 0a |g concep|ts and..|
|00000950| 63 6f 6e 73 74 72 75 63 | 74 73 20 6f 66 20 61 20 |construc|ts of a |
|00000960| 6d 75 6c 74 69 74 61 73 | 6b 69 6e 67 20 65 6e 76 |multitas|king env|
|00000970| 69 72 6f 6e 6d 65 6e 74 | 2c 20 61 6e 64 20 7b 5c |ironment|, and {\|
|00000980| 62 66 20 63 6f 6e 73 74 | 72 75 63 74 7d 20 61 0d |bf const|ruct} a.|
|00000990| 0a 67 65 6e 65 72 61 6c | 2d 70 75 72 70 6f 73 65 |.general|-purpose|
|000009a0| 20 6d 75 6c 74 69 74 61 | 73 6b 69 6e 67 20 65 6e | multita|sking en|
|000009b0| 76 69 72 6f 6e 6d 65 6e | 74 20 77 68 69 63 68 20 |vironmen|t which |
|000009c0| 69 73 20 70 6f 72 74 61 | 62 6c 65 20 74 6f 20 6d |is porta|ble to m|
|000009d0| 6f 73 74 0d 0a 73 74 61 | 63 6b 2d 62 61 73 65 64 |ost..sta|ck-based|
|000009e0| 20 6c 61 6e 67 75 61 67 | 65 73 20 61 6e 64 20 63 | languag|es and c|
|000009f0| 6f 6d 70 75 74 65 72 73 | 2e 0d 0a 0d 0a 5c 75 6e |omputers|.....\un|
|00000a00| 64 65 72 6c 69 6e 65 7b | 42 75 69 6c 64 20 41 20 |derline{|Build A |
|00000a10| 7b 5c 65 6d 20 50 6f 72 | 74 61 62 6c 65 7d 20 4d |{\em Por|table} M|
|00000a20| 75 6c 74 69 74 61 73 6b | 69 6e 67 20 45 6e 76 69 |ultitask|ing Envi|
|00000a30| 72 6f 6e 6d 65 6e 74 20 | 69 6e 20 60 60 43 27 27 |ronment |in ``C''|
|00000a40| 7d 20 77 69 6c 6c 0d 0a | 62 65 20 64 69 76 69 64 |} will..|be divid|
|00000a50| 65 64 20 69 6e 74 6f 20 | 74 68 72 65 65 20 61 72 |ed into |three ar|
|00000a60| 74 69 63 6c 65 73 3a 20 | 7b 5c 65 6d 20 53 77 69 |ticles: |{\em Swi|
|00000a70| 74 63 68 69 6e 67 20 43 | 6f 6e 74 65 78 74 73 7d |tching C|ontexts}|
|00000a80| 2c 20 7b 5c 65 6d 20 4f | 72 67 61 6e 69 7a 69 6e |, {\em O|rganizin|
|00000a90| 67 0d 0a 61 20 54 61 73 | 6b 20 46 6f 72 63 65 7d |g..a Tas|k Force}|
|00000aa0| 2c 20 61 6e 64 20 7b 5c | 65 6d 20 4d 61 6e 61 67 |, and {\|em Manag|
|00000ab0| 69 6e 67 20 52 65 73 6f | 75 72 63 65 73 7d 2e 20 |ing Reso|urces}. |
|00000ac0| 20 54 68 65 20 63 6f 64 | 65 20 66 6f 72 20 74 68 | The cod|e for th|
|00000ad0| 65 0d 0a 6d 75 6c 74 69 | 74 61 73 6b 69 6e 67 20 |e..multi|tasking |
|00000ae0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 69 73 20 61 |environm|ent is a|
|00000af0| 6c 72 65 61 64 79 20 64 | 65 73 69 67 6e 65 64 20 |lready d|esigned |
|00000b00| 61 6e 64 20 73 75 69 74 | 61 62 6c 65 20 66 6f 72 |and suit|able for|
|00000b10| 0d 0a 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 6f |..distri|bution o|
|00000b20| 6e 20 42 49 58 2e 20 20 | 54 6f 20 64 61 74 65 2c |n BIX. |To date,|
|00000b30| 20 74 68 65 20 63 6f 64 | 65 20 66 6f 72 20 74 68 | the cod|e for th|
|00000b40| 65 20 66 69 72 73 74 20 | 61 72 74 69 63 6c 65 20 |e first |article |
|00000b50| 72 75 6e 73 0d 0a 73 75 | 63 63 65 73 73 66 75 6c |runs..su|ccessful|
|00000b60| 6c 79 20 6f 6e 20 7b 5c | 65 6d 20 62 6f 74 68 7d |ly on {\|em both}|
|00000b70| 20 4d 53 2d 44 4f 53 20 | 61 6e 64 20 55 4e 49 58 | MS-DOS |and UNIX|
|00000b80| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste|
|00000b90| 6d 73 20 28 73 65 65 20 | 74 68 65 0d 0a 55 4e 49 |ms (see |the..UNI|
|00000ba0| 58 20 60 60 6d 61 6e 27 | 27 20 70 61 67 65 20 28 |X ``man'|' page (|
|00000bb0| 65 6e 63 6c 6f 73 65 64 | 29 20 66 6f 72 20 61 20 |enclosed|) for a |
|00000bc0| 62 72 69 65 66 20 73 79 | 6e 6f 70 73 69 73 20 6f |brief sy|nopsis o|
|00000bd0| 66 20 77 68 61 74 20 69 | 74 20 64 6f 65 73 29 2e |f what i|t does).|
|00000be0| 20 20 57 69 74 68 0d 0a | 69 74 20 61 6c 6f 6e 65 | With..|it alone|
|00000bf0| 2c 20 74 68 65 20 72 65 | 61 64 65 72 20 63 61 6e |, the re|ader can|
|00000c00| 20 77 72 69 74 65 20 70 | 72 6f 67 72 61 6d 73 20 | write p|rograms |
|00000c10| 77 68 69 63 68 20 68 61 | 76 65 20 6d 75 6c 74 69 |which ha|ve multi|
|00000c20| 70 6c 65 20 74 68 72 65 | 61 64 73 20 6f 66 0d 0a |ple thre|ads of..|
|00000c30| 65 78 65 63 75 74 69 6f | 6e 20 61 6e 64 20 61 72 |executio|n and ar|
|00000c40| 65 20 7b 5c 65 6d 20 70 | 6f 72 74 61 62 6c 65 7d |e {\em p|ortable}|
|00000c50| 20 62 65 74 77 65 65 6e | 20 4d 53 2d 44 4f 53 20 | between| MS-DOS |
|00000c60| 61 6e 64 20 55 4e 49 58 | 2e 20 20 54 68 6f 75 67 |and UNIX|. Thoug|
|00000c70| 68 20 74 68 69 73 20 69 | 6e 0d 0a 69 74 73 65 6c |h this i|n..itsel|
|00000c80| 66 20 69 73 20 61 20 6d | 61 6a 6f 72 20 61 63 68 |f is a m|ajor ach|
|00000c90| 69 65 76 65 6d 65 6e 74 | 2c 20 74 68 65 20 63 6f |ievement|, the co|
|00000ca0| 64 65 20 61 6c 73 6f 20 | 73 65 72 76 65 73 20 61 |de also |serves a|
|00000cb0| 73 20 61 6e 20 69 6d 70 | 6f 72 74 61 6e 74 0d 0a |s an imp|ortant..|
|00000cc0| 61 64 64 69 74 69 6f 6e | 20 74 6f 20 62 6f 74 68 |addition| to both|
|00000cd0| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste|
|00000ce0| 6d 73 20 28 4d 53 2d 44 | 4f 53 20 70 72 6f 76 69 |ms (MS-D|OS provi|
|00000cf0| 64 65 73 20 6e 6f 20 63 | 6f 6e 63 75 72 72 65 6e |des no c|oncurren|
|00000d00| 63 79 0d 0a 6d 65 63 68 | 61 6e 69 73 6d 73 20 61 |cy..mech|anisms a|
|00000d10| 6e 64 20 55 4e 49 58 20 | 70 72 6f 76 69 64 65 73 |nd UNIX |provides|
|00000d20| 20 6e 6f 20 6f 72 20 6c | 69 74 74 6c 65 20 73 68 | no or l|ittle sh|
|00000d30| 61 72 65 64 20 6d 65 6d | 6f 72 79 29 2e 0d 0a 0d |ared mem|ory)....|
|00000d40| 0a 28 53 65 65 20 74 68 | 65 20 6f 75 74 6c 69 6e |.(See th|e outlin|
|00000d50| 65 20 61 6e 64 20 73 61 | 6d 70 6c 65 20 74 65 78 |e and sa|mple tex|
|00000d60| 74 20 28 65 6e 63 6c 6f | 73 65 64 29 20 66 6f 72 |t (enclo|sed) for|
|00000d70| 20 6d 6f 72 65 20 69 6e | 66 6f 72 6d 61 74 69 6f | more in|formatio|
|00000d80| 6e 20 61 62 6f 75 74 0d | 0a 74 68 65 20 66 69 72 |n about.|.the fir|
|00000d90| 73 74 20 61 72 74 69 63 | 6c 65 2e 29 0d 0a 0d 0a |st artic|le.)....|
|00000da0| 49 20 68 61 76 65 20 63 | 6f 6d 65 20 74 6f 20 77 |I have c|ome to w|
|00000db0| 72 69 74 65 20 74 68 69 | 73 20 70 61 63 6b 61 67 |rite thi|s packag|
|00000dc0| 65 20 66 6f 72 20 74 68 | 65 20 73 61 6d 65 20 72 |e for th|e same r|
|00000dd0| 65 61 73 6f 6e 20 49 20 | 65 78 70 65 63 74 20 79 |eason I |expect y|
|00000de0| 6f 75 72 0d 0a 72 65 61 | 64 65 72 73 20 77 69 6c |our..rea|ders wil|
|00000df0| 6c 20 62 65 20 69 6e 74 | 65 72 65 73 74 65 64 20 |l be int|erested |
|00000e00| 69 6e 20 69 74 2e 20 20 | 49 20 61 6d 20 6f 6e 65 |in it. |I am one|
|00000e10| 20 6f 66 20 79 6f 75 72 | 20 72 65 67 75 6c 61 72 | of your| regular|
|00000e20| 20 73 75 62 73 63 72 69 | 62 65 72 73 0d 0a 61 6e | subscri|bers..an|
|00000e30| 64 20 61 6e 20 75 6e 64 | 65 72 67 72 61 64 75 61 |d an und|ergradua|
|00000e40| 74 65 20 61 74 20 4d 49 | 54 2e 20 20 46 75 6e 64 |te at MI|T. Fund|
|00000e50| 65 64 20 62 79 20 61 20 | 63 6f 6d 70 65 74 69 74 |ed by a |competit|
|00000e60| 69 76 65 20 72 65 73 65 | 61 72 63 68 20 67 72 61 |ive rese|arch gra|
|00000e70| 6e 74 20 66 72 6f 6d 0d | 0a 74 68 65 20 49 6e 73 |nt from.|.the Ins|
|00000e80| 74 69 74 75 74 65 2c 20 | 49 20 61 6d 20 64 65 76 |titute, |I am dev|
|00000e90| 65 6c 6f 70 69 6e 67 20 | 61 20 64 69 73 74 72 69 |eloping |a distri|
|00000ea0| 62 75 74 65 64 20 6f 70 | 65 72 61 74 69 6e 67 20 |buted op|erating |
|00000eb0| 73 79 73 74 65 6d 20 66 | 6f 72 0d 0a 68 65 74 65 |system f|or..hete|
|00000ec0| 72 6f 67 65 6e 65 6f 75 | 73 20 73 6d 61 6c 6c 2d |rogeneou|s small-|
|00000ed0| 73 79 73 74 65 6d 73 20 | 65 6e 76 69 72 6f 6e 6d |systems |environm|
|00000ee0| 65 6e 74 73 2e 20 20 54 | 68 65 20 6f 70 65 72 61 |ents. T|he opera|
|00000ef0| 74 69 6e 67 20 73 79 73 | 74 65 6d 20 72 65 71 75 |ting sys|tem requ|
|00000f00| 69 72 65 73 20 61 0d 0a | 73 6f 6c 69 64 20 62 75 |ires a..|solid bu|
|00000f10| 74 20 70 6f 72 74 61 62 | 6c 65 20 6d 75 6c 74 69 |t portab|le multi|
|00000f20| 74 61 73 6b 69 6e 67 20 | 62 61 73 69 73 2e 0d 0a |tasking |basis...|
|00000f30| 0d 0a 49 66 20 79 6f 75 | 20 64 65 63 69 64 65 20 |..If you| decide |
|00000f40| 74 6f 20 67 6f 20 77 69 | 74 68 20 74 68 69 73 20 |to go wi|th this |
|00000f50| 61 72 74 69 63 6c 65 20 | 28 6f 72 20 70 65 72 68 |article |(or perh|
|00000f60| 61 70 73 20 74 68 65 20 | 73 65 72 69 65 73 29 2c |aps the |series),|
|00000f70| 20 49 20 6c 6f 6f 6b 0d | 0a 66 6f 72 77 61 72 64 | I look.|.forward|
|00000f80| 20 74 6f 20 77 6f 72 6b | 69 6e 67 20 77 69 74 68 | to work|ing with|
|00000f90| 20 79 6f 75 20 73 6f 20 | 74 68 61 74 20 49 20 63 | you so |that I c|
|00000fa0| 61 6e 20 74 61 69 6c 6f | 72 20 74 68 65 20 61 72 |an tailo|r the ar|
|00000fb0| 74 69 63 6c 65 20 74 6f | 20 79 6f 75 72 0d 0a 72 |ticle to| your..r|
|00000fc0| 65 71 75 69 72 65 6d 65 | 6e 74 73 2e 0d 0a 0d 0a |equireme|nts.....|
|00000fd0| 5c 6d 65 64 73 6b 69 70 | 0d 0a 53 69 6e 63 65 72 |\medskip|..Sincer|
|00000fe0| 65 6c 79 2c 0d 0a 5c 62 | 69 67 73 6b 69 70 0d 0a |ely,..\b|igskip..|
|00000ff0| 5c 62 65 67 69 6e 7b 63 | 65 6e 74 65 72 7d 0d 0a |\begin{c|enter}..|
|00001000| 4d 69 6b 65 20 50 61 72 | 6b 65 72 5c 5c 0d 0a 4d |Mike Par|ker\\..M|
|00001010| 49 54 20 2d 20 31 39 38 | 39 0d 0a 5c 65 6e 64 7b |IT - 198|9..\end{|
|00001020| 63 65 6e 74 65 72 7d 0d | 0a 0d 0a 5c 6e 65 77 70 |center}.|...\newp|
|00001030| 61 67 65 0d 0a 5c 62 65 | 67 69 6e 7b 66 69 67 75 |age..\be|gin{figu|
|00001040| 72 65 7d 0d 0a 5c 63 61 | 70 74 69 6f 6e 7b 4f 75 |re}..\ca|ption{Ou|
|00001050| 74 6c 69 6e 65 20 66 6f | 72 20 7b 5c 65 6d 20 53 |tline fo|r {\em S|
|00001060| 77 69 74 63 68 69 6e 67 | 20 43 6f 6e 74 65 78 74 |witching| Context|
|00001070| 73 7d 7d 0d 0a 0d 0a 5c | 62 65 67 69 6e 7b 64 65 |s}}....\|begin{de|
|00001080| 73 63 72 69 70 74 69 6f | 6e 7d 0d 0a 0d 0a 09 5c |scriptio|n}.....\|
|00001090| 69 74 65 6d 5b 49 6e 74 | 72 6f 64 75 63 74 69 6f |item[Int|roductio|
|000010a0| 6e 5d 20 2d 0d 0a 09 5c | 62 65 67 69 6e 7b 65 6e |n] -...\|begin{en|
|000010b0| 75 6d 65 72 61 74 65 7d | 0d 0a 0d 0a 09 09 5c 69 |umerate}|......\i|
|000010c0| 74 65 6d 20 54 68 65 20 | 4e 65 65 64 20 66 6f 72 |tem The |Need for|
|000010d0| 20 28 50 6f 72 74 61 62 | 6c 65 29 20 4d 75 6c 74 | (Portab|le) Mult|
|000010e0| 69 74 61 73 6b 69 6e 67 | 0d 0a 0d 0a 09 09 5c 69 |itasking|......\i|
|000010f0| 74 65 6d 20 54 68 65 20 | 46 75 6e 64 61 6d 65 6e |tem The |Fundamen|
|00001100| 74 61 6c 20 43 6f 6e 74 | 65 78 74 20 53 77 69 74 |tal Cont|ext Swit|
|00001110| 63 68 2e 2e 2e 0d 0a 0d | 0a 09 5c 65 6e 64 7b 65 |ch......|..\end{e|
|00001120| 6e 75 6d 65 72 61 74 65 | 7d 0d 0a 0d 0a 09 5c 69 |numerate|}.....\i|
|00001130| 74 65 6d 5b 57 68 61 74 | 27 73 20 41 20 43 6f 6e |tem[What|'s A Con|
|00001140| 74 65 78 74 20 53 77 69 | 74 63 68 3f 5d 20 2d 0d |text Swi|tch?] -.|
|00001150| 0a 09 5c 62 65 67 69 6e | 7b 65 6e 75 6d 65 72 61 |..\begin|{enumera|
|00001160| 74 65 7d 0d 0a 0d 0a 09 | 09 5c 69 74 65 6d 20 54 |te}.....|.\item T|
|00001170| 68 65 20 4e 6f 2d 52 65 | 74 75 72 6e 20 2f 20 4d |he No-Re|turn / M|
|00001180| 75 6c 74 69 70 6c 65 2d | 52 65 74 75 72 6e 20 41 |ultiple-|Return A|
|00001190| 70 70 72 6f 61 63 68 0d | 0a 0d 0a 09 09 5c 69 74 |pproach.|.....\it|
|000011a0| 65 6d 20 54 68 65 20 53 | 77 69 74 63 68 2d 46 75 |em The S|witch-Fu|
|000011b0| 6e 63 74 69 6f 6e 20 41 | 70 70 72 6f 61 63 68 0d |nction A|pproach.|
|000011c0| 0a 0d 0a 09 5c 65 6e 64 | 7b 65 6e 75 6d 65 72 61 |....\end|{enumera|
|000011d0| 74 65 7d 0d 0a 0d 0a 09 | 5c 69 74 65 6d 5b 42 75 |te}.....|\item[Bu|
|000011e0| 69 6c 64 69 6e 67 20 61 | 20 43 6f 6e 74 65 78 74 |ilding a| Context|
|000011f0| 20 53 77 69 74 63 68 20 | 69 6e 20 60 60 43 27 27 | Switch |in ``C''|
|00001200| 5d 20 2d 0d 0a 09 5c 62 | 65 67 69 6e 7b 65 6e 75 |] -...\b|egin{enu|
|00001210| 6d 65 72 61 74 65 7d 0d | 0a 0d 0a 09 09 5c 69 74 |merate}.|.....\it|
|00001220| 65 6d 20 54 68 65 20 54 | 68 72 65 61 64 20 43 6c |em The T|hread Cl|
|00001230| 75 73 74 65 72 20 2d 20 | 44 61 74 61 20 53 74 72 |uster - |Data Str|
|00001240| 75 63 74 75 72 65 0d 0a | 0d 0a 09 09 5c 69 74 65 |ucture..|....\ite|
|00001250| 6d 20 54 68 65 20 54 68 | 72 65 61 64 20 43 6c 75 |m The Th|read Clu|
|00001260| 73 74 65 72 20 2d 20 43 | 6f 64 65 20 53 74 72 75 |ster - C|ode Stru|
|00001270| 63 74 75 72 65 0d 0a 0d | 0a 09 09 5c 62 65 67 69 |cture...|...\begi|
|00001280| 6e 7b 69 74 65 6d 69 7a | 65 7d 0d 0a 09 09 09 5c |n{itemiz|e}.....\|
|00001290| 69 74 65 6d 20 41 63 68 | 69 65 76 69 6e 67 20 41 |item Ach|ieving A|
|000012a0| 74 6f 6d 69 63 69 74 79 | 20 77 69 74 68 20 53 69 |tomicity| with Si|
|000012b0| 67 6e 61 6c 73 20 61 6e | 64 20 53 65 6d 61 70 68 |gnals an|d Semaph|
|000012c0| 6f 72 65 73 0d 0a 09 09 | 09 5c 69 74 65 6d 20 53 |ores....|.\item S|
|000012d0| 77 69 74 63 68 69 6e 67 | 20 42 65 74 77 65 65 6e |witching| Between|
|000012e0| 20 43 6f 6e 74 65 78 74 | 73 3a 20 7b 5c 65 6d 20 | Context|s: {\em |
|000012f0| 6d 70 74 68 64 5c 5f 73 | 77 69 74 63 68 7d 0d 0a |mpthd\_s|witch}..|
|00001300| 09 09 09 5c 69 74 65 6d | 20 43 72 65 61 74 69 6e |...\item| Creatin|
|00001310| 67 20 61 6e 64 20 44 65 | 73 74 72 6f 79 69 6e 67 |g and De|stroying|
|00001320| 20 43 6f 6e 74 65 78 74 | 73 3a 0d 0a 09 09 09 09 | Context|s:......|
|00001330| 7b 5c 65 6d 20 6d 70 74 | 68 64 5c 5f 69 6e 69 74 |{\em mpt|hd\_init|
|00001340| 7d 20 61 6e 64 20 7b 5c | 65 6d 20 6d 70 74 68 64 |} and {\|em mpthd|
|00001350| 5c 5f 64 69 6e 69 74 7d | 0d 0a 09 09 5c 65 6e 64 |\_dinit}|....\end|
|00001360| 7b 69 74 65 6d 69 7a 65 | 7d 0d 0a 0d 0a 09 5c 65 |{itemize|}.....\e|
|00001370| 6e 64 7b 65 6e 75 6d 65 | 72 61 74 65 7d 0d 0a 0d |nd{enume|rate}...|
|00001380| 0a 09 5c 69 74 65 6d 5b | 50 75 74 74 69 6e 67 20 |..\item[|Putting |
|00001390| 74 68 65 20 43 6f 6e 74 | 65 78 74 20 53 77 69 74 |the Cont|ext Swit|
|000013a0| 63 68 20 74 6f 20 47 6f | 6f 64 20 55 73 65 5d 20 |ch to Go|od Use] |
|000013b0| 2d 0d 0a 09 5c 62 65 67 | 69 6e 7b 65 6e 75 6d 65 |-...\beg|in{enume|
|000013c0| 72 61 74 65 7d 0d 0a 09 | 09 5c 69 74 65 6d 20 53 |rate}...|.\item S|
|000013d0| 6f 66 74 77 61 72 65 2d | 44 72 69 76 65 6e 20 53 |oftware-|Driven S|
|000013e0| 77 69 74 63 68 69 6e 67 | 20 24 5c 4c 6f 6e 67 6c |witching| $\Longl|
|000013f0| 65 66 74 61 72 72 6f 77 | 24 20 49 6e 74 65 72 70 |eftarrow|$ Interp|
|00001400| 72 6f 63 65 73 73 20 43 | 6f 6d 6d 75 6e 69 63 61 |rocess C|ommunica|
|00001410| 74 69 6f 6e 0d 0a 09 09 | 5c 69 74 65 6d 20 48 61 |tion....|\item Ha|
|00001420| 72 64 77 61 72 65 2d 44 | 72 69 76 65 6e 20 53 77 |rdware-D|riven Sw|
|00001430| 69 74 63 68 69 6e 67 20 | 24 5c 4c 6f 6e 67 6c 65 |itching |$\Longle|
|00001440| 66 74 61 72 72 6f 77 24 | 20 52 65 73 6f 75 72 63 |ftarrow$| Resourc|
|00001450| 65 20 4d 61 6e 61 67 65 | 6d 65 6e 74 0d 0a 09 5c |e Manage|ment...\|
|00001460| 65 6e 64 7b 65 6e 75 6d | 65 72 61 74 65 7d 0d 0a |end{enum|erate}..|
|00001470| 0d 0a 09 5c 69 74 65 6d | 5b 43 6f 6e 63 6c 75 73 |...\item|[Conclus|
|00001480| 69 6f 6e 73 5d 20 2d 2d | 0d 0a 0d 0a 5c 65 6e 64 |ions] --|....\end|
|00001490| 7b 64 65 73 63 72 69 70 | 74 69 6f 6e 7d 0d 0a 5c |{descrip|tion}..\|
|000014a0| 65 6e 64 7b 66 69 67 75 | 72 65 7d 0d 0a 0d 0a 5c |end{figu|re}....\|
|000014b0| 62 65 67 69 6e 7b 66 69 | 67 75 72 65 7d 0d 0a 5c |begin{fi|gure}..\|
|000014c0| 63 61 70 74 69 6f 6e 7b | 53 61 6d 70 6c 65 20 54 |caption{|Sample T|
|000014d0| 65 78 74 20 66 72 6f 6d | 20 7b 5c 65 6d 20 53 77 |ext from| {\em Sw|
|000014e0| 69 74 63 68 69 6e 67 20 | 43 6f 6e 74 65 78 74 73 |itching |Contexts|
|000014f0| 7d 7d 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 71 75 6f |}}....\b|egin{quo|
|00001500| 74 65 7d 0d 0a 5c 62 65 | 67 69 6e 7b 63 65 6e 74 |te}..\be|gin{cent|
|00001510| 65 72 7d 20 5c 62 66 0d | 0a 42 75 69 6c 64 20 41 |er} \bf.|.Build A|
|00001520| 20 5c 5c 0d 0a 7b 5c 65 | 6d 20 50 6f 72 74 61 62 | \\..{\e|m Portab|
|00001530| 6c 65 7d 20 4d 75 6c 74 | 69 74 61 73 6b 69 6e 67 |le} Mult|itasking|
|00001540| 20 45 6e 76 69 72 6f 6e | 6d 65 6e 74 5c 5c 0d 0a | Environ|ment\\..|
|00001550| 69 6e 20 60 60 43 27 27 | 5c 5c 0d 0a 2d 2d 2d 2d |in ``C''|\\..----|
|00001560| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001570| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 5c 5c |--------|------\\|
|00001580| 0d 0a 7b 5c 65 6d 20 5c | 23 31 20 2d 20 53 77 69 |..{\em \|#1 - Swi|
|00001590| 74 63 68 69 6e 67 20 43 | 6f 6e 74 65 78 74 73 7d |tching C|ontexts}|
|000015a0| 0d 0a 5c 65 6e 64 7b 63 | 65 6e 74 65 72 7d 0d 0a |..\end{c|enter}..|
|000015b0| 0d 0a 2e 2e 2e 49 6e 20 | 73 68 6f 72 74 2c 20 77 |.....In |short, w|
|000015c0| 65 20 77 6f 75 6c 64 20 | 6c 69 6b 65 20 74 6f 20 |e would |like to |
|000015d0| 63 72 65 61 74 65 20 61 | 20 7b 5c 62 66 20 70 61 |create a| {\bf pa|
|000015e0| 72 61 6c 6c 65 6c 20 70 | 72 6f 67 72 61 6d 6d 69 |rallel p|rogrammi|
|000015f0| 6e 67 0d 0a 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 7d |ng..envi|ronment}|
|00001600| 2c 20 61 6e 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |, an env|ironment|
|00001610| 20 77 68 69 63 68 20 68 | 61 73 20 73 65 76 65 72 | which h|as sever|
|00001620| 61 6c 20 74 61 73 6b 73 | 20 74 6f 20 64 6f 20 61 |al tasks| to do a|
|00001630| 74 20 6f 6e 63 65 0d 0a | 28 7b 5c 62 66 20 6d 75 |t once..|({\bf mu|
|00001640| 6c 74 69 74 61 73 6b 69 | 6e 67 7d 29 20 61 6e 64 |ltitaski|ng}) and|
|00001650| 20 70 6f 73 73 69 62 6c | 79 20 73 65 76 65 72 61 | possibl|y severa|
|00001660| 6c 20 70 72 6f 63 65 73 | 73 6f 72 73 20 74 6f 20 |l proces|sors to |
|00001670| 64 6f 20 74 68 65 6d 20 | 28 7b 5c 62 66 0d 0a 6d |do them |({\bf..m|
|00001680| 75 6c 74 69 70 72 6f 63 | 65 73 73 69 6e 67 7d 29 |ultiproc|essing})|
|00001690| 2e 20 20 49 6e 20 74 68 | 65 20 68 65 61 72 74 20 |. In th|e heart |
|000016a0| 6f 66 20 6f 75 72 20 70 | 61 72 61 6c 6c 65 6c 20 |of our p|arallel |
|000016b0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 77 69 6c 6c |environm|ent will|
|000016c0| 20 6c 69 76 65 0d 0a 74 | 68 65 20 7b 5c 62 66 20 | live..t|he {\bf |
|000016d0| 73 63 68 65 64 75 6c 65 | 72 7d 2c 20 74 68 65 20 |schedule|r}, the |
|000016e0| 60 60 63 6f 6d 70 75 74 | 65 72 27 73 20 65 6e 74 |``comput|er's ent|
|000016f0| 72 65 70 72 65 6e 65 75 | 72 27 27 20 77 68 69 63 |repreneu|r'' whic|
|00001700| 68 20 74 72 69 65 73 20 | 74 6f 0d 0a 73 63 68 65 |h tries |to..sche|
|00001710| 64 75 6c 65 20 74 68 65 | 20 70 72 6f 63 65 73 73 |dule the| process|
|00001720| 69 6e 67 20 72 65 73 6f | 75 72 63 65 73 20 74 6f |ing reso|urces to|
|00001730| 20 6d 65 65 74 20 74 68 | 65 20 74 61 73 6b 73 27 | meet th|e tasks'|
|00001740| 20 63 6f 6d 70 75 74 61 | 74 69 6f 6e 61 6c 0d 0a | computa|tional..|
|00001750| 64 65 6d 61 6e 64 73 2e | 20 20 54 68 65 20 73 63 |demands.| The sc|
|00001760| 68 65 64 75 6c 65 72 20 | 69 6e 73 75 72 65 73 20 |heduler |insures |
|00001770| 65 61 63 68 20 70 72 6f | 63 65 73 73 6f 72 20 69 |each pro|cessor i|
|00001780| 73 20 68 61 72 64 20 61 | 74 20 77 6f 72 6b 20 6f |s hard a|t work o|
|00001790| 6e 20 61 0d 0a 74 61 73 | 6b 3b 20 68 6f 77 65 76 |n a..tas|k; howev|
|000017a0| 65 72 2c 20 74 68 65 72 | 65 20 61 72 65 20 75 73 |er, ther|e are us|
|000017b0| 75 61 6c 6c 79 20 6d 6f | 72 65 20 74 61 73 6b 73 |ually mo|re tasks|
|000017c0| 20 74 6f 20 72 75 6e 20 | 74 68 61 6e 20 74 68 65 | to run |than the|
|000017d0| 72 65 20 61 72 65 0d 0a | 70 72 6f 63 65 73 73 6f |re are..|processo|
|000017e0| 72 73 2c 20 61 6e 64 20 | 74 61 73 6b 73 20 77 69 |rs, and |tasks wi|
|000017f0| 6c 6c 20 6f 66 74 65 6e | 20 69 6e 73 69 73 74 20 |ll often| insist |
|00001800| 6f 6e 20 77 61 69 74 69 | 6e 67 20 66 6f 72 20 73 |on waiti|ng for s|
|00001810| 6f 6d 65 74 68 69 6e 67 | 20 61 6e 64 0d 0a 63 6f |omething| and..co|
|00001820| 75 6c 64 20 77 61 73 74 | 65 20 70 72 6f 63 65 73 |uld wast|e proces|
|00001830| 73 6f 72 20 74 69 6d 65 | 2e 20 20 54 68 65 72 65 |sor time|. There|
|00001840| 66 6f 72 65 2c 20 74 68 | 65 20 73 63 68 65 64 75 |fore, th|e schedu|
|00001850| 6c 65 72 20 6d 75 73 74 | 20 72 65 67 75 6c 61 72 |ler must| regular|
|00001860| 6c 79 0d 0a 73 77 69 74 | 63 68 20 61 20 70 72 6f |ly..swit|ch a pro|
|00001870| 63 65 73 73 6f 72 20 66 | 72 6f 6d 20 6f 6e 65 20 |cessor f|rom one |
|00001880| 74 61 73 6b 20 74 6f 20 | 61 6e 6f 74 68 65 72 2c |task to |another,|
|00001890| 20 69 74 20 6d 75 73 74 | 20 7b 5c 62 66 20 73 77 | it must| {\bf sw|
|000018a0| 69 74 63 68 7d 20 74 68 | 65 0d 0a 70 72 6f 63 65 |itch} th|e..proce|
|000018b0| 73 73 6f 72 27 73 20 7b | 5c 62 66 20 63 6f 6e 74 |ssor's {|\bf cont|
|000018c0| 65 78 74 7d 2e 0d 0a 0d | 0a 43 6f 6e 74 65 78 74 |ext}....|.Context|
|000018d0| 20 73 77 69 74 63 68 69 | 6e 67 20 69 73 20 61 6e | switchi|ng is an|
|000018e0| 20 65 78 74 72 65 6d 65 | 6c 79 20 63 6f 6d 6d 6f | extreme|ly commo|
|000018f0| 6e 20 61 63 74 69 76 69 | 74 79 20 77 69 74 68 69 |n activi|ty withi|
|00001900| 6e 20 6d 75 6c 74 69 74 | 61 73 6b 69 6e 67 0d 0a |n multit|asking..|
|00001910| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 73 3b 20 69 74 |environm|ents; it|
|00001920| 20 6d 75 73 74 20 62 65 | 20 64 6f 6e 65 20 65 66 | must be| done ef|
|00001930| 66 69 63 69 65 6e 74 6c | 79 20 69 66 20 74 68 65 |ficientl|y if the|
|00001940| 20 73 79 73 74 65 6d 20 | 69 73 20 74 6f 20 70 65 | system |is to pe|
|00001950| 72 66 6f 72 6d 0d 0a 77 | 65 6c 6c 2e 20 20 49 74 |rform..w|ell. It|
|00001960| 20 61 6c 73 6f 20 69 73 | 20 61 20 68 69 67 68 6c | also is| a highl|
|00001970| 79 20 6d 61 63 68 69 6e | 65 2d 64 65 70 65 6e 64 |y machin|e-depend|
|00001980| 65 6e 74 20 61 63 74 69 | 76 69 74 79 3b 20 69 74 |ent acti|vity; it|
|00001990| 20 69 6e 76 6f 6c 76 65 | 73 0d 0a 63 6f 6d 70 6c | involve|s..compl|
|000019a0| 65 74 65 6c 79 20 72 65 | 70 6c 61 63 69 6e 67 20 |etely re|placing |
|000019b0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 7b 5c 62 66 |the curr|ent {\bf|
|000019c0| 20 73 74 61 74 65 7d 20 | 6f 66 20 74 68 65 20 70 | state} |of the p|
|000019d0| 72 6f 63 65 73 73 6f 72 | 20 77 69 74 68 0d 0a 61 |rocessor| with..a|
|000019e0| 6e 6f 74 68 65 72 2e 20 | 20 4d 6f 73 74 20 69 6d |nother. | Most im|
|000019f0| 70 6f 72 74 61 6e 74 6c | 79 2c 20 68 6f 77 65 76 |portantl|y, howev|
|00001a00| 65 72 2c 20 63 6f 6e 74 | 65 78 74 20 73 77 69 74 |er, cont|ext swit|
|00001a10| 63 68 69 6e 67 20 69 73 | 20 61 20 64 65 6c 69 63 |ching is| a delic|
|00001a20| 61 74 65 0d 0a 61 6e 64 | 20 74 72 69 63 6b 79 20 |ate..and| tricky |
|00001a30| 6f 70 65 72 61 74 69 6f | 6e 3b 20 69 66 20 6e 6f |operatio|n; if no|
|00001a40| 74 20 64 6f 6e 65 20 77 | 69 74 68 20 63 61 72 65 |t done w|ith care|
|00001a50| 20 61 6e 64 20 63 6f 6e | 73 69 73 74 65 6e 63 79 | and con|sistency|
|00001a60| 2c 20 6f 6e 65 0d 0a 70 | 72 6f 63 65 73 73 6f 72 |, one..p|rocessor|
|00001a70| 20 63 61 6e 20 75 6e 65 | 78 70 65 63 74 65 64 6c | can une|xpectedl|
|00001a80| 79 20 63 72 61 73 68 20 | 74 68 65 20 65 6e 74 69 |y crash |the enti|
|00001a90| 72 65 20 73 79 73 74 65 | 6d 2c 20 61 6e 64 20 74 |re syste|m, and t|
|00001aa0| 68 65 20 74 69 6d 69 6e | 67 0d 0a 62 75 67 73 20 |he timin|g..bugs |
|00001ab0| 61 72 65 20 75 6e 70 72 | 65 64 69 63 74 61 62 6c |are unpr|edictabl|
|00001ac0| 65 20 61 6e 64 20 6f 66 | 74 65 6e 20 69 6d 70 6f |e and of|ten impo|
|00001ad0| 73 73 69 62 6c 65 20 74 | 6f 20 72 65 70 72 6f 64 |ssible t|o reprod|
|00001ae0| 75 63 65 2e 20 20 53 6f | 20 66 6f 72 0d 0a 65 66 |uce. So| for..ef|
|00001af0| 66 69 63 69 65 6e 63 79 | 2c 20 70 6f 72 74 61 62 |ficiency|, portab|
|00001b00| 69 6c 69 74 79 2c 20 61 | 6e 64 20 73 69 6d 70 6c |ility, a|nd simpl|
|00001b10| 69 63 69 74 79 2c 20 74 | 68 69 73 20 61 72 74 69 |icity, t|his arti|
|00001b20| 63 6c 65 20 70 72 65 73 | 65 6e 74 73 20 61 0d 0a |cle pres|ents a..|
|00001b30| 63 6f 6e 74 65 78 74 20 | 73 77 69 74 63 68 20 7b |context |switch {|
|00001b40| 5c 62 66 20 61 62 73 74 | 72 61 63 74 69 6f 6e 7d |\bf abst|raction}|
|00001b50| 2c 20 65 6e 63 61 70 73 | 75 6c 61 74 69 6e 67 20 |, encaps|ulating |
|00001b60| 61 6c 6c 20 74 68 65 20 | 64 65 74 61 69 6c 73 20 |all the |details |
|00001b70| 6f 66 0d 0a 63 6f 6e 74 | 65 78 74 20 73 77 69 74 |of..cont|ext swit|
|00001b80| 63 68 69 6e 67 20 69 6e | 74 6f 20 61 20 73 69 6e |ching in|to a sin|
|00001b90| 67 6c 65 2c 20 70 6f 77 | 65 72 66 75 6c 20 7b 5c |gle, pow|erful {\|
|00001ba0| 62 66 20 63 6f 6e 74 72 | 6f 6c 20 63 6f 6e 73 74 |bf contr|ol const|
|00001bb0| 72 75 63 74 7d 2e 2e 2e | 0d 0a 0d 0a 5c 65 6e 64 |ruct}...|....\end|
|00001bc0| 7b 71 75 6f 74 65 7d 0d | 0a 5c 65 6e 64 7b 66 69 |{quote}.|.\end{fi|
|00001bd0| 67 75 72 65 7d 0d 0a 0d | 0a 5c 65 6e 64 7b 64 6f |gure}...|.\end{do|
|00001be0| 63 75 6d 65 6e 74 7d 0d | 0a |cument}.|. |
+--------+-------------------------+-------------------------+--------+--------+