Aa!:r|}    `P0   `P 0PP`PHH $ @d HHHH̀̀̀ff@  d Footnote TableFootnote**.\t.\t/ - :;,.!?/ d.e;TOCHeading1Heading2   UEquationVariablesE ACfCCCDD#AAAAAA  <$lastpagenum><$monthname> <$daynum>, <$year>"<$monthnum>/<$daynum>/<$shortyear>J<$hour>:<$minute00> <$ampm> on <$dayname>, <$monthname> <$daynum>, <$year>"<$monthnum>/<$daynum>/<$shortyear><$monthname> <$daynum>, <$year>"<$monthnum>/<$daynum>/<$shortyear> <$fullfilename> <$filename> <$paratext[Title]> <$paratext[Heading1]> <$curpagenum> <$marker1> <$marker2> (Continued)+ (Sheet <$tblsheetnum> of <$tblsheetcount>)Heading & Page <$paratext> on page<$pagenum>Pagepage<$pagenum>See Heading & Page%See <$paratext> on page<$pagenum>. Table All7Table<$paranumonly>, <$paratext>, on page<$pagenum>Table Number & Page'Table<$paranumonly> on page<$pagenum>Heading <$paratext>BHTML Headings++A335577A<<>>@@A2ABBBBB B B BBBBBBBBBB!B#B%B'B)B+B-B/B1B3B5B7B9B;B=B?BABCBEBGBHBIBKBMBOBQBSBUBWBYB[B]B^B_BaBcBeBgBiBkBmBoBqBsBuBwByB{B}BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCC C C CCCCCCCCCC!C#C%C'C)C+C-C/C1C3C5C7C9C;C=C?CACCCECGCICKCMCOCQCSCUCWCYC[C]C_CaCcCeChCjClCnCpCrCtCvCxCzC|C~CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCD%D'D)D+D-D/D1D3D5D7D9D;D=D?DADCDEDGDH$@D,CCCCC;#$CCC;/;2CD_2.Av4.DAnswer: @(3.DDDDD D DDDDDDD$DAnswer: DAnswer: DAnswer: D D D AS&1.AAA$B?Pdq5+dAdA! HmRAHmRHRHRFootnote Hr@AHr@HzHz Single LineHA Footnote A  HDA HDHH Double LineHA  Double LineA A HA  Single LineA d5p77HZA! TableFootnotedAdBl dAd1QRUX[^adgjmpsvy| %).1W,Bm }d Ad WaHTML Mapping Table }Hd BHd Wa }Hd BHd Wa }Hd BHd Wa }Hd BHd Wa }HBH! FrameMaker PA Source Item }H B H Wa HTML Item }H B H Wa }HBH W aInclude Auto# } HB H W a Comments }HBH W a }HHB HH W aElement }HB#H W a New Topic? }HBH Wa } HB H Wa }H B $H Wa P:Date Line }HH B#%HH WaP }H B $&H WaN }H B"%'H WaN } H B$&( H Wa }EH B&')EH Wa P:Reading }HEH B((*HEH WaP }EH B*)+EH WaN }EH B,*,EH WaN } EH B.+- EH Wa }QH B0,.QH WaP:Title }HQH B2-/HQH WaH* }QH B4.0QH WaN }QH B6/1QH WaN } QH B802 QH Wa }]H B:13]H WaP:Body }H]H B<24H]H W aP }]H B>35]H W!aN }]H B@46]H W"aN } ]H BB57 ]H W#a }iH(BD68iH( W$a P:Numbered1 }HiH(BF79HiH((%aLI &a Parent = OL Q'a Depth = 0 }iH(BJ8:iH( W(aN }iH(BL9;iH( W)aY } iH(BN:< iH( W*a }H BP;=H  W+a P:Heading1 }HH BR<>HH  W,aH* }H BT=?H  W-aN }H BV>@H  W.aN } H BX?A H  W/a }H(BZ@BH(  W0a P:Numbered }HH(B\ACHH(( 1aP 2a Parent = OL Q3a Depth = 0 }H(B`BDH(  W4aN }H(BbCEH(  W5aY } H(BdDF H(  W6a }H BfEGH  W7a P:CellBody }HH BhFHHH  W8aP }H BjGIH  W9aN }H BlHJH  W:aN } H BnIK H  W;a }H BpJLH  W<aP:CellHeading }HH BrKMHH  W=aP }H BtLNH  W>aN }H BvMOH  W?aN } H BxNP H  W@a }H BzOQH  WAa P:Footnote }HH B|PRHH  WBaP }H B~QSH  WCaN }H BRTH  WDaN } H BSU H  WEa }H(BTVH( WFa P:Bulleted }HH(BUWHH((GaLI Ha Parent = UL QIa Depth = 0 }H(BVXH( WJaN }H(BWYH( WKaN } H(BXZ H( WLa }H BY[H WMa P:Heading2 }HH BZ\HH WNaH* }H B[]H WOaN }H B\^H WPaN } H B]_ H WQa }HB^`HR! P:HeadingRuPAnIn }HHB_aHH WSaP }HB`bH WTaN }HBacH WUaN } HBbd H WVa }7H Bce7H WWa P:Indented }H7H BdfH7H WXaP }7H Beg7H WYaN }7H Bfh7H WZaN } 7H Bgi 7H W[a }CHBhjCH\! P:TableFootPAnote }HCHBikHCH W]aP }CHBjlCH W^aN }CHBkmCH W_aN } CHBln CH W`a }]H(Bmo]H( Waa P:TableTitle }H]H(BnpH]H((baLI ca Parent = OL Qda Depth = 0 }]H(Boq]H( WeaN }]H(Bpr]H( WfaN } ]H(Bqs ]H( Wga }H BrtH Wha P:BodySpaced }HH BsuHH WiaP }H BtvH WjaN }H BuwH WkaN } H Bvx H Wla }H BwyH WmaP:Date }HH BxzHH WnaP }H By{H WoaN }H Bz|H WpaN } H B{} H Wqa }H(B|~H(r! P:NumberedPASpaced }HH(B}HH((saP ta Parent = OL Qua Depth = 0 }H(B~H( WvaN }H(BH( WwaY } H(B H( Wxa }H BH WyaP:DateProject }HH BHH WzaP }H BH W{aN }H BH W|aN } H B H W}a }H BH W~a C:BoldItalic }HH B HH WaSTRONG }H B H WaN }H B H WaN } H B H Wa }HB H! C:EquationPA Variables }HHB HH WaEM }HB H WaN }HBH WaN } HC H Wa }H CH Wa C:Italic }HH CHH W aEM }H CH W aN }H CH W aN } H C  H W a }H C H W aC:Bold }HH CHH WaSTRONG }H CH WaN }H CH WaN } H C H Wa }HCH! X:Heading & PAPage }HHCHH Wa See Also }HCH WaN }HCH WaN } HC H Wa })H C !)H WaX:Page }H)H C" "H)H Wa See Also })H C$!#)H WaN })H C&"$)H WaN } )H C(#% )H Wa }5HC*$&5H! X:See HeadPA ing & Page }H5HC,%'H5H Wa See Also }5HC.&(5H WaN }5HC0')5H WaN } 5HC2(* 5H W a }OH C4)+OH W!a X:Table All }HOH C6*,HOH W"a See Also }OH C8+-OH W#aN }OH C:,.OH W$aN } OH C<-/ OH W%a }[HC>.0[H &! X:Table NumPA ber & Page }H[HC@/1H[H  W'a See Also }[HCB02[H  W(aN }[HCD13[H  W)aN } [HCF24 [H  W*a }uHCH35uH !W+a X:Heading }HuHCJ46HuH!,! USE XREF PAFMT }uHCL57uH !W-aN }uHCN68uH !W.aN } uHCP79 uH !W/a }HCR8:H "W0a P:Header }HHCT9;HH"1!THROW PAAWAY }HCV:<H "W2aN }HCX;=H "W3aN } HCZ<> H "W4a }©H C\=?©H #W5a }H©H C^>@H©H #W6a }©H C`?A©H #W7a }©H Cb@B©H #W8a } ©H CdAC ©H #W9a }»d CgBF»d $W:aHTML Options Table }D»d CiD»d $W;a }D»d CkD»d $W<a }D CmCGD %W=a }DH CoFHDH %W>a }H CqGIH %W?a }D CsHJD &W@a Image Format }DH CuIKDH &WAaIMAGGIF }H CwJLH &WBa }D CyKMD 'WCaBanners }DH C{LNDH 'WDaN }H C}MOH 'WEa }DCNPD(F! Banner ReferPA ence Frame }DHCOQDH (WGa }HCPH (WHa }D(C:SD((C)I! Copy Files  Imported by PA Rerefernce }DH(C:RTDH( C)WJa }H(C:SUH( C)WKa }DD C:TVDD C*WLa }DDH C:UWDDH C*WMa }DH C:VXDH C*WNa }Vd C:W[Vd C+WOaSystem Macros }?Vd C:?Vd C+WPa }?Vd C:?Vd C+WQa }f? C:X\f? C,WRa Macro Name }?fH C:[]?fH C,WSa Replace With }fH C:\^fH C,WTa Comments }r? C:]_r? C-WUa StartOfDoc }?rH C:^`?rH C-WVa }rH C:_arH C-WWa }~? C:`b~? C.WXa EndOfDoc }?~H C:ac?~H C.WYa }~H C:bd~H C.WZa }?C:ce?C/[! StartOfSubPADoc }?HC:df?H C/W\a }HC:egH C/W]a }?C:fh?C0^! EndOfSubPADoc }?HC:gi?H C0W_a }HC:hjH C0W`a }?C:ik?C1a! StartOfFirstPASubDoc }?HC:jl?H C1Wba }HC:kmH C1Wca }?C:ln?C2d! EndOfFirstPASubDoc }?HC:mo?H C2Wea }HC:npH C2Wfa }?C:oq?C3g! StartOfLastPASubDoc }?HC:pr?H C3Wha }HC:qsH C3Wia } ?C:rt ?C4j! EndOfLastPASubDoc }? HC:su? H C4Wka } HC:tv H C4Wla }&? C:uw&? C5Wma }?&H C:vx?&H C5Wna }&H C:wy&H C5Woa }8d C:x|8d C6WpaCross-Reference Macros }?8d C:?8d C6Wqa }?8d C:?8d C6Wra }H? C:y}H? C7Wsa Macro Name }?HH C:|~?HH C7Wta Replace With }HH C:}HH C7Wua Comments }T?C:~T? C8Wva See Also }?THC:?THC8w! See Also: PA <$paratext> }THC:TH C8Wxa }n? C:n? C9Wya }?nH C:?nH C9Wza }nH C:nH C9W{a }d C: d C:WaGeneral Macros }?d C:?d C:Wa }?d C:?d C:Wa }?d C:?d C:Wa }? C:"? C;Wa Macro Name dD  dD! d l dD" do  WBm }d D$ d  <W|aHeadings Table }Hd D& Hd  <W}a }Hd D( Hd  <W~a }HD* H =!Paragraph ForPAmat }HHD, HH  =WaHeading Level }HD. H  =Wa Comments }HD0 H >W aTitle }HHD2 HH  >Wa }HD4 H  >Wa }KH D6 KH  ?Wa Heading1 }HKH D8 HKH  ?Wa }KH D: KH  ?Wa }WH D< WH  @Wa Heading2 }HWH D> HWH  @W a }WH D@ WH  @W a }cH DB cH  AW a }HcH DD HcH  AW a }cH DF cH  AW a # EGxRAEGxREPwEPw TableFootnote}?H C: #?H C;Wa Replace With }H C:"$H C;WaHead }H C:#%H C;Wa Comments }? C:$&? CBWa }?H D:%'?H CBW a }H D:&(H CBW!a }H D:')H CBW"a }d D:(.d CCW#aCharacter Macros HHˆ;"HHˆ+Ge HHˆ;$3HHˆ**l}?d D :?d CCW$a }?d D :?d CCW%a }? D :)/? CDW&a Macro Name }?H D:.0?H CDW'a Replace With }H D:/1H CDW(a Comments }? D:08? CEW)a HUV ;.HUV 3Ge HUV ;05+HUV 22l H$ ;1H$ 5Ge H$ ;33H$ 44l HHˆ;4HHˆf!//7  `Answers to Homework #2  `5Due Date : February 1, 2001 Points : 60 A@ y( 10 points ) Number all the forks in the Dining Philosopher's problem and require that each philosopher request 0Lnan even-numbered fork before an odd-numbered fork. Will this allocation strategy prevent deadlock and starva@Gtion? Is it a form of a well-known strategy (named in section 3.9.3)? ! hYes. This solution avoids deadlock because there is no longer any symmetry in the way the philosophers rpick up their forks (that is, all cannot pick up their left forks simultaneously.) Assuming philosophers pick up pforks in the order each fork is requested, it avoids starvation because only one philosopher can pick up either vfork; the others are constrained to pick up one particular fork, and in some cases that fork is the left one while in @aother cases that fork is the right one. This is an example of the heirarchical allocation rule. r ( 15 points ) Using the definitions given in class, prove that  S  is not a deadlock state does not imply that  S  is a q@safe state. -*D< Let  S  be a state other than a deadlocked state. Then there exists no process  p i  which is deadlocked in  S . 0/By definition this means there is at least one state  T  for which  S  *  T  and  p i  is not blocked in  T . Note the words *at least in the above sentence; it is certainly possible that there is some state  T'  for which  S  *  T' ,  p i  is blocked 0in  T' , and for every state  T''  reachable from  T' ,  p i  is blocked. In this case there is at least one state  T'  reachable UU@Sfrom  S  that is a deadlock state; hence,  S  is not a safe state. O ( 15 points ) Assume a system has  p  processes and  r  identical units of a reusble resource. If each process can claim 0Nat most  n  units of the resource, show that the system will be deadlock free if, and only if,  r   p ( n 1)+1 [text, @problem 3.7]. .!3 q(  ) Assume the system is deadlock free. At least one process must have all its resource requests satis0-3fied. In the worst case, all processes request  n  units of the resource. If only one process is to have its requests satxisfied, each process can hold up to  n 1 units of the resource, with one unit left over (to satisfy one of the @iprocesses). Hence there must be at least  p ( n 1)+1 units of the resource, as claimed. !2 (  ) Assume a system of the sort described above has at least  p ( n 1)+1 units of a resource. Let  p  processes request  n  resource units. Each process can acquire  n 1 units of the rsource, and the remaining unit will be given xto one of theprocesses. The others block. However, that one process can run to completion. It then releases  n  H$ == l H$ A;H$ <WDhHAnswers to Homework #2 ECS 251 Winter 2001Page  1  HUV A;<@HUV ?? l HUV A;HUV >WEhALast modified at 3:07 pm on Wednesday, March 14, 2001 HHˆA;>HHˆAA l HHˆA;HHˆ@WFe dD:dCC l dD:dR9BRUX[^adgjmpsvy| %).1dLeftd;Rightd ReferenceddHTMLd:HTMLd Headings@@ VMapping Table Title. @@ VBody. L̀Lf@N V Numbered N:.< =1>. L̀Lf@N V ~Numbered N:.< =1>. @@ VFooter. f@T V TableTitleT:Table : . f@ V Answer1ItalicAnswer: . $f@ V Answer. f@ V Answer1ItalicAnswer: . @@ VHeader Double Line. f@ V CellFooting. f@ V CellHeading. f@ V CellBody. @@ VMapping Table Cell. @@1Mapping Table Cell. @@ 1Mapping Table Cell. @@ VMapping Table Cell.  f@PVTitleBody. f@ VBody. f@NE V Numbered1 N:.Numbered. f@ VBody. L̀Lf@N V 6Numbered N:.< =1>. f@ V BodySpaced. f@ V. BodySpaced Single Line. f@ V Bulleted\t. f@ V...Date. mf@ Vl. DateProject. @@ VHeader Double Line. f@  $.6.Z.~..CodeC. f@T VHeading1Body. $f@ V Answer. f@ V NumberedSpaced. f@ V.Reading.  f@PVTitleBody. f@$V.Line Single Line. f@ VCellBody. f@ V CellHeading. f@ V Footnote. f@T VHeading2Body. f@T V HeadingRunInBody. f@ V Indented. f@ V TableFootnote. f@T V TableTitleT:Table : . f@NE V Numbered1 N:.Numbered. $f@L V$. Lettereda L:.. $f@L V$. LetteredL:.. L̀Lf@N V Numbered N:.< =1>. 6$f@R V6. Romani R:.. 6$f@R V6. RomanR:.. f@ V BodyIndent. f@  $.6.Z.u..CodeASM. Hf@ VH.. CodeComment.  V V VItalic V 1 V ڝVV  V V V ڝV V R SymbolVEmphasis V1 V V  SubscriptVEquationVariables 1  BoldItalic VItalic VBoldR Symbol   ComputerZZThinMediumDoubleThick@ Very Thin HHHHHFormat AH Mapping Table HHHHHFormat BH$$$ Mapping Tableh*|#HHHHHf$*DHH+5?HH&69?HH :B?HHH CE?HH*6 ? @ h( A B C D E h  F G H I J h  K L M N O h  P Q R S T h( UVWXYh Z[\]^h_`abc7h defghChijklm]h(nopqrh stuvwh xyz{|h(}~h h    h  h h h)h  !"#$5h%&'()Oh  *+,-.[h!/ 0 1 2 3 uh "4!5!6!7!8!h!#9":";"<"="©h ">#?#@#A#B#» %C$D$E$ $&F%G%H% %'I&J&K& &(L'M'N'')O(P(Q(((*CR)S)T)D )CU*V*W*V ,CX+Y+Z+f +-C[,\,],r ,.C^-_-`-~ -/Ca.b.c..0Cd/e/f//1Cg0h0i002Cj1k1l113Cm2n2o224Cp3q3r3 35Cs4t4u4& 4Cv5w5x58 7Cy6z6{6H 68C|7}7~7T79C888n 8C999 ;C:::: :BC ;";#;$; =  <<<<> ====? >>>K >@ ???W ?A @@@c @ AAA ;C%B&B'B(B DC)C,C-C CEC.D/D0D DC1E8E9EComment A AAd BlackT!WhiteddARedddGreendd BluedCyandMagentad YellowHeader/Footer $1Header/Footer $1Header/Footer $2Header/Footer $2IndexIndexCommentCommentSubjectSubjectAuthorAuthorGlossaryGlossaryEquationEquation Hypertext Hypertext  Cross-Ref Cross-Ref Conditional TextConditional TextPositionFMPrivatePositionFMPrivateRangeEndFMPrivateRangeEndFMPrivate HTML Macro HTML Macro M.Times.P Times-Roman FrameRoman M.Times.B Times-Bold FrameRoman M.Helvetica.BHelvetica-Bold FrameRoman M.Courier.PCourier FrameRoman M.Times.I Times-Italic FrameRoman M.Symbol.PSymbol FrameRomanM.Helvetica.BIHelvetica-BoldOblique FrameRoman FrameRoman FrameRomanbCourier0 HelveticaQSymbolUTimes#Regular$Roman MediumBoldRegular ObliqueItalicù4b̟lc1gPdb!% S+w[V#Mslpǿ6mkBVVdVb_XԎU< &m<yS L.g$,\GNT-ݿb=0y`:лM[