ﺑﻪ ﻧﺎﻡ ﺧﺪﺍ ﺳﻴﺴﺘﻢ ﻫﺎﻱ ﻋﺎﻣﻞ ﮔﺮﻭﻩ ) 1ﺍﺳﺘﺎﺩ :ﺩﻛﺘﺮ ﺟﻠﻴﻠﻲ( ﺗﻤﺮﻳﻨﺎﺕ ﺳﺮﻱ ﺩﻭﻡ )ﻓﺼﻞ ﻫﺎﻱ 4 ،3ﻭ (5 .1 ﺗﺮﻡ ﭘﺎﻳﻴﺰ 1389 ﻣﻬﻠﺖ ﺗﺤﻮﻳﻞ89/8/30 : ﺍﻟﻒ( ﻫﺮ ﻳﻚ ﺍﺯ ﻣﻔﺎﻫﻴﻢ ﺯﻳﺮ ﺭﺍ ﺑﻄﻮﺭ ﻣﺨﺘﺼﺮ ﺗﻮﺿﻴﺢ ﺩﻫﻴﺪ: • • • • Swapping Spooling Buffering Dispatcher ﺏ( ﺭﺍﻩ ﻫﺎﻱ ﻣﺨﺘﻠﻔﻲ ﻛﻪ ﻣﻲ ﺗﻮﺍﻥ ﻳﻚ ﻧﺦ ﺭﺍ ﻣﻠﻐﻲ ﻛﺮﺩ ﻧﺎﻡ ﺑﺮﺩﻩ ﻭ ﻫﺮ ﻳﻚ ﺭﺍ ﺑﻄﻮﺭ ﻣﺨﺘﺼﺮ ﺗﻮﺿﻴﺢ ﺩﻫﻴﺪ. ﺝ( ﻛﺎﺭﻫﺎﻳﻲ ﻛﻪ ﺗﻮﺳﻂ ﺳﻴﺴﺘﻢ ﻋﺎﻣﻞ ﺑﺮﺍﻱ ﺗﻌﻮﻳﺾ ﻣﺘﻦ ﺩﺭ ﻫﺮ ﻳﻚ ﺍﺯ ﻣﻮﺍﺭﺩ ﺯﻳﺮ ﺍﻧﺠﺎﻡ ﻣﻲ ﺷﻮﺩ ﺭﺍ ﺗﻮﺿﻴﺢ ﺩﻫﻴﺪ. -ﺑﻴﻦ ﻓﺮﺁﻳﻨﺪﻫﺎ ﺑﻴﻦ ﻧﺦ ﻫﺎ.2 ﻳﻚ ﻓﺮﺁﻳﻨﺪ ﻳﺎ ﻧﺦ� ،ﻣﻲ ﺗﻮﺍﻧﺪ ﺷﺎﻣﻞ ﻫﻤﻪ ﻳﺎ ﺑﺮﺧﻲ ﺍﺯ ﻣﻮﻟﻔﻪ ﻫﺎﻱ ﺯﻳﺮ ﺑﺎﺷﺪ. F0 ) (1ﻣﻘﺎﺩﻳﺮ ﺭﺟﻴﺴﺘﺮ ) (2ﺣﺎﻓﻈﻪ heap ) (3ﻣﺘﻐﻴﺮﻫﺎﻱ ﻋﻤﻮﻣﻲ ) (4ﺣﺎﻓﻈﻪ ﭘﺸﺘﻪ )TCB (5 )PCB (6 ) (7ﺳﮕﻤﻨﺖ ﺩﺍﺩﻩ ) (8ﺳﮕﻤﻨﺖ ﻛﺪ ﻛﺪﺍﻡ ﻳﻚ ﺍﺯ ﺍﻳﻦ ﻣﻮﻟﻔﻪ ﻫﺎ ﺗﻮﺳﻂ ﺟﻔﺖ ﻫﺎﻱ ﺯﻳﺮ ﺑﺼﻮﺭﺕ ﻣﺸﺘﺮﻙ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ؟ ﺍﻟﻒ( ﻳﻚ ﻓﺮﺁﻳﻨﺪ ﭼﻨﺪﻧﺨﻲ ﻭ ﻳﻜﻲ ﺍﺯ ﻧﺦ ﻫﺎﻱ ﺁﻥ ﺏ( ﻫﺮ ﺩﻭ ﻧﺦ ﺩﺭ ﻳﻚ ﻓﺮﺁﻳﻨﺪ ﭼﻨﺪ ﻧﺨﻲ ﺝ( ﻫﺮ ﺩﻭ ﻓﺮﺁﻳﻨﺪ ﻓﺮﺯﻧﺪ ﺍﺯ ﻳﻚ ﻓﺮﺁﻳﻨﺪ ﭘﺪﺭ .3 ﻫﺮ ﻓﺮﺁﻳﻨﺪ ﻣﻲ ﺗﻮﺍﻧﺪ ﺩﺭ ﻳﻜﻲ ﺍﺯ ﺣﺎﻻﺕ :ﺁﻣﺎﺩﻩ ،ﺩﺭ ﺣﺎﻝ ﺍﺟﺮﺍ ،ﻣﻨﺘﻈﺮ ﻭ ﺧﺎﺗﻤﻪ ﻳﺎﻓﺘﻪ ﺑﺎﺷﺪ .ﭼﻪ ﺍﺗﻔﺎﻗﺎﺗﻲ ﻣﻲ ﺗﻮﺍﻧﺪ ﻣﻮﺟﺐ ﺗﻐﻴﻴﺮ ﺣﺎﻟﺖ ﻫﺎﻱ ﺯﻳﺮ ﺷﻮﺩ: ﺍﻟﻒ( ﺩﺭ ﺣﺎﻝ ﺍﺟﺮﺍ ﺑﻪ ﺁﻣﺎﺩﻩ ﺏ( ﺩﺭ ﺣﺎﻝ ﺍﺟﺮﺍ ﺑﻪ ﻣﻨﺘﻈﺮ thread 1 ﺝ( ﻣﻨﺘﻈﺮ ﺑﻪ ﺁﻣﺎﺩﻩ ﺩ( ﻣﻨﺘﻈﺮ ﺑﻪ ﺧﺎﺗﻤﻪ ﻳﺎﻓﺘﻪ .4 ﺍﻟﻒ( ﺑﺮﺍﻱ ﻓﺮﺁﻳﻨﺪ ﺯﻳﺮ ﻧﻤﻮﺩﺍﺭ ﮔﺬﺭ ﺁﻧﺮﺍ ﺭﺳﻢ ﻛﻨﻴﺪ. -ﻓﺮﺽ ﻛﻨﻴﺪ ﺗﻨﻬﺎ ﺍﻳﻦ ﻓﺮﺁﻳﻨﺪ ﺩﺭ ﺳﻴﺴﺘﻢ ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﻭ ﻛﺪ ﺍﺟﺮﺍﻳﻲ ﻗﺒﻼ ﺩﺭ ﺳﻴﺴﺘﻢ ﺑﺎﺭﮔﺬﺍﺭﻱ ﺷﺪﻩ ﺍﺳﺖ. ﺑﺮﺍﻱ ﻫﺮ ﺣﺎﻟﺖ ،ﻋﺒﺎﺭﺗﻲ ﺭﺍ ﻛﻪ ﺍﺟﺮﺍ ﺧﻮﺍﻫﺪ ﻛﺮﺩ ﺭﺍ ﻣﺸﺨﺺ ﻛﻨﻴﺪ .ﺍﮔﺮ ﻳﻚ ﺣﺎﻟﺖ ﺑﻴﺶ ﺍﺯ ﻳﻚ ﺑﺎﺭ ﺍﺗﻔﺎﻕ ﻣﻲ ﺍﻓﺘﺪ ،ﺁﻧﺮﺍ ﭼﻨﺪﻳﻦ ﺑﺎﺭﻧﻤﺎﻳﺶ ﺩﻫﻴﺪ. ﻫﺮ ﻋﺒﺎﺭﺕ I/Oﺭﺍ ﻳﻚ ﺩﺳﺘﻮﺭ ﺟﺪﺍﮔﺎﻧﻪ ﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﻧﺪﻩ ﺩﺭ ﻧﻈﺮ ﺑﮕﻴﺮﻳﺪ.)(int main { ;int i,j ;ofstream myfile ;i=100 ;j=2*i ;)"myfile.open("example.txt ;"myfile<<"Writing this to a file.\n ;)(myfile.close ;j=j*2 ;cout<<j<<endl ;return 0 } ﺏ( ﻓﺮﺽ ﻛﻨﻴﺪ ﻫﺮ ﺍﺟﺮﺍﻱ ﻫﺮ ﺩﺳﺘﻮﺭ 1ﻭﺍﺣﺪ ﺯﻣﺎﻧﻲ ﻃﻮﻝ ﻣﻲ ﻛﺸﺪ .ﺗﻌﻮﻳﺾ ﻣﺘﻦ 5ﻭﺍﺣﺪ ﺯﻣﺎﻧﻲ ﻭ ﻫﺮ ﻋﻤﻞ 20 ،I/Oﻭﺍﺣﺪ ﺯﻣﺎﻧﻲ ﻃﻮﻝ ﻣﻲ ﻛﺸﺪ .ﻛﻞ ﺯﻣﺎﻥ ﻻﺯﻡ ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ ﻓﺮﺁﻳﻨﺪ ﺑﺎﻻ ﺍﺯ ﺯﻣﺎﻧﻲ ﻛﻪ ﺩﺭ ﺳﻴﺴﺘﻢ ﺑﺎﺭﮔﺬﺍﺭﻱ ﺷﺪﻩ ﺗﺎ ﺍﺗﻤﺎﻡ ﺁﻥ ﺭﺍ ﻣﺤﺎﺳﺒﻪ ﻛﻨﻴﺪ. .5 ﺷﺒﻪ ﻛﺪﻱ ﺑﻨﻮﻳﺴﻴﺪ ﻛﻪ ﺩﺭﺧﺖ ﻓﺮﺁﻳﻨﺪﻱ ﺑﺼﻮﺭﺕ ﺷﻜﻞ ﺯﻳﺮ ﺑﻮﺟﻮﺩ ﺁﻭﺭﺩ ،ﺑﻄﻮﺭﻳﻜﻪ : ،P5 -ﺑﺮﻧﺎﻣﻪ ﺍﻱ ﺑﻪ ﻧﺎﻡ sortﺭﺍ ﺍﺟﺮﺍ ﻣﻲ ﻛﻨﺪ. ،P4 -ﺑﺮﻧﺎﻣﻪ ﺍﻱ ﺑﻪ ﻧﺎﻡ permutationﺭﺍ ﺍﺟﺮﺍ ﻣﻲ ﻛﻨﺪ. ،P2ﺗﺎ ﺧﺎﺗﻤﻪ ﻓﺮﺁﻳﻨﺪ ،P3ﺻﺒﺮ ﻣﻲ ﻛﻨﺪ ﻭ ﺳﭙﺲ ﻓﺮﺁﻳﻨﺪ P4ﺭﺍ ﺍﺯ ﺑﻴﻦ ﻣﻲ ﺑﺮﺩ.P1 P2 P3 P5 P4 .6 ﺩﺭﺳﺘﻲ ﻳﺎ ﻧﺎﺩﺭﺳﺘﻲ ﻋﺒﺎﺭﺍﺕ ﺯﻳﺮ ﺭﺍ ﺗﻌﻴﻴﻦ ﻛﺮﺩﻩ ﻭ ﺑﺮﺍﻱ ﭘﺎﺳﺦ ﺧﻮﺩ ﺗﻮﺿﻴﺢ ﻣﺨﺘﺼﺮﻱ ﺑﻨﻮﻳﺴﻴﺪ. ﺍﻟﻒ( ﺑﺮﺵ ﺯﻣﺎﻧﻲ ﻛﻮﭼﻚ ﻫﻤﻮﺍﺭﻩ ﻣﺘﻮﺳﻂ ﺯﻣﺎﻥ ﺧﺎﺗﻤﻪ ﻳﻚ ﺳﻴﺴﺘﻢ ﺭﺍ ﺑﻬﺒﻮﺩ ﻣﻲ ﺑﺨﺸﺪ. � ﺏ( ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺯﻣﺎﻧﺒﻨﺪ ،round robinﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺑﺮﺵ ﺯﻣﺎﻧﻲ ﺑﺰﺭگ ﺑﺮﺍﻱ ﻛﺎﺭﺑﺮﺍﻥ ﻣﺤﺎﻭﺭﻩ ﺍﻱ ﺧﻮﺏ ﻧﻴﺴﺖ. F1 ﺝ( SJFﺑﺮﺍﻱ ﭘﻴﺎﺩﻩ ﺳﺎﺯﻱ ﺭﻭﻱ ﻳﻚ ﺳﻴﺴﺘﻢ ﻋﺎﻣﻞ ﻭﺍﻗﻌﻲ ،ﺩﺷﻮﺍﺭ ﺍﺳﺖ. .7 5ﻓﺮﺁﻳﻨﺪ ﺑﺎ ﻣﺸﺨﺼﺎﺕ ﺯﻳﺮ ﻭﺟﻮﺩ ﺩﺍﺭﺩ. ﻓﺮﺁﻳﻨﺪ ﺯﻣﺎﻥ ﻭﺭﻭﺩ ﺯﻣﺎﻥ ﺳﺮﻭﻳﺲ A B C D E 0 2 4 6 8 3 6 4 5 2 ﻣﺘﻮﺳﻂ ﺯﻣﺎﻥ ﭘﺎﺳﺨﮕﻮﻳﻲ� ﻭ ﻣﺘﻮﺳﻂ ﺯﻣﺎﻥ ﺍﻧﺘﻈﺎﺭ� ﺭﺍ ﺑﺮﺍﻱ ﻫﺮ ﻳﻚ ﺍﺯ ﺭﻭﺵ ﻫﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ RR ،HRRN ،SRT ،SJF ،FCFSﺑﺎ ﻛﻮﺍﻧﺘﻮﻡ F3 F2 ﺯﻣﺎﻧﻲ 1ﻣﻴﻠﻲ ﺛﺎﻧﻴﻪ RR ،ﺑﺎ ﻛﻮﺍﻧﺘﻮﻡ ﺯﻣﺎﻧﻲ 4ﻣﻴﻠﻲ ﺛﺎﻧﻴﻪ MLFQ ،ﺑﺎ ) MLFQ ،RR(q=1ﺑﺎ ) RR(q=2ﻣﺤﺎﺳﺒﻪ ﻛﻨﻴﺪ .ﺑﺮﺍﻱ ﻫﺮ ﺭﻭﺵ ﻧﻤﻮﺩﺍﺭ ﮔﺎﻧﺖ ﻧﻴﺰ ﺭﺳﻢ ﺷﻮﺩ. .8 4ﻓﺮﺁﻳﻨﺪ ﺑﺎ ﻣﺸﺨﺼﺎﺕ ﺯﻳﺮ ﻭﺟﻮﺩ ﺩﺍﺭﺩ: ﻓﺮﺁﻳﻨﺪ ﺯﻣﺎﻥ ﻭﺭﻭﺩ ﺯﻣﺎﻥ ﺳﺮﻭﻳﺲ ﺍﻭﻟﻮﻳﺖ A B C D 10 15 20 25 15 5 10 5 4 3 2 1 ﺍﻟﻒ( ﻣﺘﻮﺳﻂ ﺯﻣﺎﻥ ﭘﺎﺳﺨﮕﻮﻳﻲ ﻭ ﻣﺘﻮﺳﻂ ﺯﻣﺎﻥ ﺍﻧﺘﻈﺎﺭ ﺭﺍ ﺑﺮﺍﻱ ﺭﻭﺵ ﺯﻣﺎﻧﺒﻨﺪﻱ SJFﺍﻧﺤﺼﺎﺭﻱ� ﻣﺤﺎﺳﺒﻪ ﻛﻨﻴﺪ .ﻧﻤﻮﺩﺍﺭ ﮔﺎﻧﺖ ﻭ ﺩﻳﮕﺮ F4 ﺟﺰﺋﻴﺎﺕ ﻻﺯﻡ ﻧﻤﺎﻳﺶ ﺩﺍﺩﻩ ﺷﻮﺩ) .ﺩﺭ ﺻﻮﺭﺕ ﻭﺟﻮﺩ ﺗﺴﺎﻭﻱ ،ﺍﻭﻟﻮﻳﺖ ﺑﺎ ﭘﺮﺩﺍﺯﺵ ﺩﺭ ﺣﺎﻝ ﺍﺟﺮﺍﺳﺖ(. ﺏ( ﻗﺴﻤﺖ )ﺍﻟﻒ( ﺭﺍ ﺑﺎ ﺩﺭ ﻧﻈﺮ ﮔﺮﻓﺘﻦ ﺭﻭﺵ ﺯﻣﺎﻧﺒﻨﺪﻱ round-robinﺑﺎ ﻛﻮﺍﻧﺘﻮﻡ ﺯﻣﺎﻧﻲ 5ﻭﺍﺣﺪ ﭘﺎﺳﺦ ﺩﻫﻴﺪ. ﺝ( ﻓﺮﺽ ﻛﻨﻴﺪ ﺗﻌﻮﻳﺾ ﻣﺘﻦ 0.1ﻭﺍﺣﺪ ﺯﻣﺎﻧﻲ ﻃﻮﻝ ﻣﻲ ﻛﺸﺪ .ﺩﺭﺻﺪ ﺳﺮﺑﺎﺭ ﻧﺎﺷﻲ ﺍﺯ ﺗﻌﻮﻳﺾ ﻣﺘﻦ ﺭﺍ ﺑﺮﺍﻱ ﻫﺮ ﻳﻚ ﺍﺯ ﺩﻭ ﺭﻭﺵ ﺫﻛﺮ ﺷﺪﻩ ﻣﺤﺎﺳﺒﻪ ﻛﻨﻴﺪ. 2 interactive Turnaround time 4 Waiting time 5 preemptive 3 .9 ﺩﺭ ﺳﻴﺴﺘﻤﻲ ﺯﻣﺎﻥ ﺗﻌﻮﻳﺾ ﻣﺘﻦ Sﺑﻮﺩﻩ ﻭ ﺍﺯ ﺳﻴﺎﺳﺖ RRﺑﺎ ﺑﺮﺵ ﺯﻣﺎﻧﻲ Qﺑﺮﺍﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ .ﺍﮔﺮ ﻣﺘﻮﺳﻂ ﺯﻣﺎﻥ ﺍﺟﺮﺍﻱ ﻫﺮ ﻓﺮﺁﻳﻨﺪ ﻗﺒﻞ ﺍﺯ ﺑﻠﻮﻛﻪ ﺷﺪﻥ ﺑﻪ ﺩﻟﻴﻞ ﻋﻤﻞ T ،I/Oﺑﺎﺷﺪ ،ﺩﺭ ﻫﺮ ﻳﻚ ﺍﺯ ﺣﺎﻻﺕ ﺯﻳﺮ ﻛﺎﺭﺍﻳﻲ ﭘﺮﺩﺍﺯﻧﺪﻩ ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﻳﺪ. ﺍﻟﻒ( Q=0 ﺏ( Q>T ﺝ( S<Q<T ﺩ( Q=S .10ﺗﻔﺎﻭﺕ ﻫﺎ ﻭ ﺷﺒﺎﻫﺖ ﻫﺎﻱ ﺳﻴﺴﺘﻢ ﻋﺎﻣﻞ ﻫﺎﻱ ﻟﻴﻨﻮﻛﺲ ﻭ BSDﺭﺍ ﺫﻛﺮ ﻛﺮﺩﻩ) 4ﻣﻮﺭﺩ ﻛﺎﻓﻲ ﺍﺳﺖ( ﻭ 3ﻧﺴﺨﻪ ﭘﺮﻛﺎﺭﺑﺮﺩ BSDﺭﺍ ﺑﺎ ﻫﻢ ﻣﻘﺎﻳﺴﻪ ﻛﻨﻴﺪ)ﻫﺮﻛﺪﺍﻡ ﺑﺮﺍﻱ ﭼﻪ ﻛﺎﺭﺑﺮﺩﻱ ﻃﺮﺍﺣﻲ ﺷﺪﻩ ﺍﺳﺖ؟(
© Copyright 2025 Paperzz