You are on page 1of 16

(1 ?

. 
.
. Program Counter
.  
.
.
(2 ?
.  /
. 
.
. !
.
.
(3! )( !   !
. (running) $  )(ready
.  $
.  ) (waiting )(User Mode
.  ) (waiting )(Kernel Mode
.
.
. $  !
(4   !  ?
.!   )(Deadlock
. !
. ! signal  ! '
.wait
.   ).(Preemption
.
.
(5 (Test&Set) TSL :
.!
. ).(Busy Wait
. ).(Bounded Wait
.
.
.!
(6    )( External Interrupt
. !  ).(Deadlock
. .
.  /  / .
. .
.
.

(7  :
. ! .
. ).(Uniprocessor
.   .
. .
.
.
(8  ) (Threads  :
.  ! !  $ ! .
.    !
  .
. ) (Context !
.       .
. .
. .
(9!      / Test & Set
 :
. 
Test & Set . ! 
.
. Test & Set .
.   Test & Set .
. .
. .
(10  3 A,B,C  S,R,T :
!

 !
.

! C
T
R
T
R

! B
S
T
S
T

! A
R
S
R
S

   
 :
.    3 ' 3.
.     .
.     .
.    .
. .
. .
(11  / ) (Producer / Customer 
1 ,  :
.     / .
.   !  .
.  Space' Times .N
.     .Items
. .
. .

(12   :
  1200ns Tm
 100ns Te TLB
!    
  2290ns ) (HitRate?
0.1 .
0.8 .
0.9
.
1.1 .
. 
 .
.
*** 0.9*2400+0.1*1300 =~ 2290
(13  .   
 ) 5K( . ) (segment 12K 
 ' Free-3
:

0'5 K
5'25 K
25'35 K
35'70 K
70'88 K
88'113 K
.
.
.
.
.
.

Free-1

Free-2

Free-3

First Fit
Worst Fit
Best Fit
Next Fit
) Last Fit (


(14  ) (Swapping (Compaction) $  :


.  !  $ .
. ! $" .DMA
.  .
. !  " .DMA
.
.
(15   "  ) (Segments  ) .(Pages
  ) (  :
.  !  .
.  !  .
.  !  ! 
.
.  !  ! 
.
.   !  
.
. .

(16   ) (Protection :
.    .
.     ) (Shared Pages .
.  .
. 
.
.
(17   ) (Protection   
) (Anticipatory Paging:
.
.
.
.
.
.

!  
.
  .
  .
 !    !.



(18     ) Page Reference


(String ) (:
1,2,3,4,5,3,4,1,6,7,8,7,8,9
 OPT ,FIFO' LRU 4
 ) (:
FIFO 9 ,OPT 9 ,LRU 9 .
FIFO 10 ,OPT 9 ,LRU 10 .
FIFO 10 ,OPT 9 ,LRU 9 .
FIFO 9 ,OPT 9 ,LRU 10 .
FIFO 10 ,OPT 10 ,LRU 10 .
. .
2,3,1,0,3,2,4,3,2,1,0,4
FIFO 6 ,OPT 6 ,LRU 8
(19 ) ,(Batch    .
    ) (Non Preemptive ) (Waiting
.
. ,  ,  .
. ,  ! ,  .
. .Round Robin
. 
.    .
.

(20! ! " )( .fork !


! ?
. ))(Signal Handlers' (
) Nice Value .! ' Nice (
) Pipe Description . Pipe (.
(PPID) Parent Process ID .
) File Descriptors .  (
.
(21  Shell ) (:
Ls l | wc l
.Socket .
) Unnamed Pipe . .(Pipe
) Named Pipe . $ (Pipe
.Signals .
.
.
(22 " (SSF) SSTF ) FCFS  (FIFO :
.   .
.   .
.  )( .
. )(Starvation
.  ).(Multimedia Streams
.
(23  ):(Threshing
.       )(Not Localized
.    .
. ! 
.   !  .
.
.
(24   ) (Internal Fragmentation ) External
(Fragmetation?
.  " ,  "
.  , 
 ! .
.  ,  .
.   .
.
.

(25   ) (Round Robin  ) (Time Slice


?
. (First Come First Served) FCFS
. )(Context Switchs
.   .
.  )(Non Preemptive
.
.
(26  ) (Quantum  Round Robin :
.
.   ).(Interactive
.  
. )( !.
.
.
(27  Round- Robin!  :
.  ) (Quantum ! $.
. ! $.
. ! $ /.
. ) ( wait .
.
.
(28 200 , ) 53
( /   ) (
98, 183, 37, 122, 14, 124, 65, 67
   !  ?
FCFS .
(Shortest Seek First) SSF .
SCAN .
LOOK .
C-LOOK .
C-SCAN .
(29 40 , ) 11
( /   ) (
1,36,16,34,9,12
   !  ?
FCFS .
(Shortest Seek First) SSF .
SCAN .
LOOK .
C-LOOK .
C-SCAN .

(30  (Translation Lookaside Buffer) TLB 


) (Associative Memory :
TLB .! " .
TLB . .
TLB .   .
. )( ' TLB  .
.
.
(31 ) Maltiprogramming' (UNIX
20  18  :
.!    6 .
.!    6 .
.!    ! 5 ' 20 .
.!    5 ' 20 .
. 
.
(32  ) (True Concurrency .
.
. ,  / .
. ! .
. ! "".
.
.
(33 Pipe  :
. ' Pipe .
. ' Pipe ' .Broken Pipe
. ' Pipe  ! .
.!  ' Pipe ' Pipe .
.  .Named Pipe
.
(34     ! .
 :
.! / !   /.
. ! .
.  ) (Timeout  !   .
.    ! .
.
.
(35 ! ! 
:
.  , ! .
. !  .
.  ! .
.  .
.
.

(36  ) (User Level   )(Kernel Level


 :
.   .
.     
.
.   
.
.    )(
    .
. .
. .
(37 .   FIFO
?
. 
. ).(Bounded Wait
.  .
. .
. .
. .
(38 ! .5 20 (V) signal' 10 .(P) wait!
 :
5 .
15 .
'15 .
25 .
'25 .
.
(39    ?
. (wait) P    .
.! .
. .FIFO
.  .
.
.
(40 . )?(External Fragmentation
.   .
.   .
.  .
.    .
. .
. .

(41      ?
.    .
.    :
   .
.   .
.  
.
.
(42  ) (Segmentation   :
.  .
.  .
. ,  .
.   .
.
.
(43! 4  .   
 ' .0     ) (R ) .(M
 :
' 
2
1
0
3

'
0
1
2
3


60
130
26
20


161
160
162
163

R
0
0
1
1

M
1
0
0
1

   ' 4   
) (Clock  ) (Victim:
0 .
1 .
2 .
3 .
. 
.
(44    )(  
  ) (:
100K
200K
100K
512K
 ) C,B,A : !
(A 90K, B 60K , C 10K :
 :
4
512K




?
First Fit . 
Next Fit .
Best Fit .
Worst Fit .
. 
.

4
100K
B

2
200K

1
100K
A' C

(45   / :
. /
. /
.
. 
.
.
(46    
.  ) (
. / 
. /
. /
.
.
(47  !
 : ' Q  " PT  " ! P
!  Q ! .$
! Priority(P)=Q/PT :
100=Q :! P  $ 20'  ! 100 
' 100/20 = 5!  100' 
1 )! ( ! .
 :
.  / .
.  / .
.  / .
.  / .
.   /.
.
(48   '
 : user-mode Monitor-mode/Kernel-mode/Supervisor-
.mode
 ?
.  /
.  .
. .Interrupt Disable
.  .Base and Limit Registers
. .
(49 )?(System Call
. '.kernel
. '.System
. .
. .
. .

(50  ) (Threads !/ ) (task/process  :


.' Program Counter  .
.' Kernel  Kernel Supported Thread'.User Level Thread
. ! .
.  .
. .
(51 ) (Entry Section ) , (
:
. ).(Mutual Exclusion
. ).(Progress
. ).(Bounded Waiting
.   .
.     .
(52 ' (Test and Set) TSL 
:
. !
. )(busy wait
.    )   (
.
.
(53 / ) (scheduling ):(Convoy Effect
.(First Come First Serve) FCFS .
.(Short Remaining Time First) SRTF .
Round Robin .
.  ).(Preemptive
.
. .
(54 ,  :
5
8
2

4
6
5

3
4
6

2
2
4

1
0
3

process
arrival
burst time

 )  + ( ,
?First Come First Served FCFS
8.60 :
.4.00 :
8.20 :
.4.60 :
8.60 :
.4.60 :
8.20 :
.4.00 :
.
. .

(55

,  :

5
8
2

4
6
5

3
4
6

2
2
4

1
0
3

process
arrival
burst time

 )  + ( ,
?First Come First Served FCFS
7.60 :
.3.60 :
8.00 :
.3.20 :
7.60 :
.4.00 :
8.00 :
.3.60 :
.
. .

(56  ! ' LOOK ' SEEK 


'?SCAN
.   .
.  .
.  .
. .
.
. .

(57 $ 
  P0' ) P1' i P0 0' j 1' P1!(
) TURN' FLAG   ,  FLAG 
(FALSE
Process Pi:
#define TRUE 1
#define FALSE 0
;]int FLAG[2
;int TURN
)while(TRUE
{
;FLAG[i]= TRUE
;TURN =j
while ((FLAG[j] ==TRUE ) and TURN == j) {} ; /* meditate */

Critical_Section
;FLAG[i]=FALSE

Non_Critical_Section

 :
. )(mutual exclusion
. )(progress
. )(bounded wait
. )(busy wait
.
.
(58 /  )(?
Round Robin .
Priority .
FIFO .
Busy Wait .
.
.
(59   !?
FCFS .
(Shortest Seek First) SSF .
SCAN .
C-LOOK .
C-SCAN .
.

(60   ,  :
15%
:
99.8%
:
/ 10% :
 ?
.
. / 
.
. 
.
.!
(61  ! ?
.
. )(Progress
. )(Busy Wait
. )(Bounded Wait
. )(Deadlock
. )(Starvation
(62  ) (Threads !/ ) (Tesk/Process  :
.' PC 
.' Kernel  Kernel Supported Thread' .User Level Thread
. !
. 
.
.
(63  ' (Test and Set) TSL?
. !
. )(busy wait
.  
.  
.
.
(64     signals' Pipes ?UNIX
.   .
.  .$
.  .kill
.  "
.
.
(65  ) (Spooling  :
.
.
.' Cache
.' CPU Registers
.
.

(66 !   )(Page Fault


.  
.!   .
.!  !
.  ) (paging )(Segmentation
.
.
(67 ! ) (Dirty Bit :
. .
.    FIFO
. ) (Segmentation  )(Paging
.   )(Page Sharing
.
.
(68  ) (fixed priorities ).(with preemption
! T p (running) $  ) (ready:
.! ' p  
. Sleep ! .p
.  ) (time slice  .p
. T .I/O
.
.
(69
(70
(71

You might also like