2LFIG 2015-2016
Correction série N° 2
I.a
Formule => Temps processeur consommé = Nombre de files d’attente consommées
(Fils parcourues si le système applique le recyclage)
P1= Processus 1 P3= processus 3 P4= processus 4
P2 = Processus 2 P4 = Processus 4 P6= processus 6
Réponse
TC1= 0Q
TC2= 3Q
TC3= 2Q
TC4= < 1Q
TC5= 2Q
TC6= 1Q
I.b
Formule => Temps d’attente= Temps nécessaire pour que le processus sera actif
Chargé dans le processeur
Quantum
Processus actif
<Q
P4
1Q
P1
2 Q 3 Q
P4
P6
4 Q
P1
5 Q
P3
6 Q
P5
7 Q
P6
8 Q
P4
9 Q
P1
10 Q
P2
TA1= < Q => entre 0 et Q
TA 2= 9Q
TA 3= 4Q
TA 4= 0Q
TA 5= 5Q
TA 6= 1Q
Wiçal BEN MARZOUKA
1
2LFIG 2015-2016
I.c
Après 2 Q :
Recyclage
Publicité
P2
P5
P3
P1
P4
FP4
FP3
FP3
FP2
FP1
Processeur
P6
Entrée
I.d
Nous distinguons deux configurations différentes : selon la politique utilisée
Cas 1 : Politique sans préemption
Cette politique consiste à respecter le temps fourni à chaque processus
Recyclage
P2
P5
P3
P1
P4
FP4
FP3
FP2
FP1
Processeur
P6
Entrée
P7
Wiçal BEN MARZOUKA
2
2LFIG 2015-2016
Cas 2 : Politique avec préemption
Le processus ne respecte pas le temps fourni Q donc la création de P7 provoque une coupure,
le chargement de P6 dans le file d’attente FP1 et donner le processeur à P7.
Cela veut dire de P7 est prioritaire
Recyclage
P2
P5
P3
P1
P4
FP4
FP3
FP2
FP1
Entrée
P6
II.a
Processeur
Publicité
P7
Formules : Temps d’attente = Temps de début de calcul – Temps de soumission
Temps d’exécution = Temps de calcul + Temps d’attente
Temps moyen d’exécution : ∑ Temps d’exécution px / (Nombre de processus)
Algorithme : First In First Out
TEp1 = 3+0 = 3
TEp2 = 4+4 = 8
TEp3 = 2+2 = 4
Temps moyen d’exécution :
TME= (3+8+4)/3 = 15/3 = 5
Wiçal BEN MARZOUKA
3
2LFIG 2015-2016
Algorithme : File de priorité
TEp1 = 7+2 = 9
TEp2 = 0+4 = 4
TEp3 = 3+3 = 6
Temps moyen d’exécution :
TME= (9+4+6)/3 = 19/3 = 6.3
Algorithme : Round Robin
TEp1 = 3+2 = 5
TEp2 = 3+4 = 7
TEp3 = 2+3 = 5
Temps moyen d’exécution :
TME= (5+7+5)/3 = 17/3 = 5.7
Algorithme : Shortest Remaining Time Next
TEp1 = 1+2 = 3
TEp2 = 3+4 = 7
TEp3 = 1+3 = 4
Temps moyen d’exécution :
TME= (3+7+4)/3 = 14/3 = 4.7
II.b
Algorithme : First In First Out
TAp1 = 0
TAp2 = 3
TAp3 = 2
Temps moyen d’exécution :
TMA= (0+3+2)/3 = 5/3 = 1.7
Wiçal BEN MARZOUKA
4
2LFIG 2015-2016
Algorithme : File de priorité
TAp1 = 0
TAp2 = 0
TAp3 = 0
Temps moyen d’exécution :
TMA= (0+0+0)/3 = 0/3 = 0
Algorithme : Round Robin
TAp1 = 0
TAp2 = 1
TAp3 = 1
Temps moyen d’exécution :
Publicité
TMA= (0+1+1)/3 = 2/3 = 0.7
Algorithme : Shortest Remaining Time Next
TAp1 = 0
TAp2 = 3
TAp3 = 2
Temps moyen d’exécution :
TMA= (0+3+2)/3 = 5/3 = 1.7
II.2
P1 = (1, 2, 2)
P2 = (0, 5, 4)
P3 = (2, 4, 5)
P4 = (3, 10, 1)
Algorithme : First In First Out
L’ordre => P2 , P1 , P3 , P4
Mais dans l’énoncé ils impose l’ordre suivant P1 , P2 , P3 , P4
Wiçal BEN MARZOUKA
5
2LFIG 2015-2016
TEp1 = 2
TEp2 = 8
TEp3 = 10
TEp4 = 19
TAp1 = 0
TAp2 = 3
TAp3 = 6
TAp4 = 9
Temps moyen d’exécution :
Temps moyen d’exécution :
TME= (2+8+10+19)/4 = 39/4 = 9.75
TMA= (0+3+6+9)/4 = 18/4 = 4.5
Algorithme : Shortest Remaining Next Time
Wiçal BEN MARZOUKA
6
2LFIG 2015-2016
TEp1 = 6
TEp2 = 5
TEp3 = 9
TEp4 = 18
TAp1 = 4
TAp2 = 0
TAp3 = 5
TAp4 = 8
Temps moyen d’exécution :
Temps moyen d’exécution :
TME= (6+5+9+18)/4 = 39/4 = 9.5
TMA= (4+0+5+8)/4 = 17/4 = 4.25
Algorithme : Round Robin (Quantum =1)
TEp1 = 6
TEp2 = 13
TEp3 = 12
TEp4 = 18
TAp1 = 1
Publicité
TAp2 = 0
TAp3 = 1
TAp4 = 1
Temps moyen d’exécution :
Temps moyen d’exécution :
TME= (6+13+12+18)/4 = 49/4 =12.25
TMA= (1+0+1+1)/4 = 3/4 = 0.75
Wiçal BEN MARZOUKA
7
2LFIG 2015-2016
Algorithme : File de priorité (Quantum =1)
TEp1 = 10
TEp2 = 5
TEp3 = 7
TEp4 = 18
TAp1 = 8
TAp2 = 0
TAp3 = 3
TAp4 = 8
Temps moyen d’exécution :
Temps moyen d’exécution :
TME= (10+5+7+18)/4 = 40/4 =10
TMA= (8+0+3+8)/4 = 19/4 = 4.75
III.a
TEp1 = 230
TEp2 = 300
TEp3 = 280
TEp4 = 340
Temps moyen d’exécution :
TME= (230+300+280+340)/4 = 1150/4 = 287.5
Wiçal BEN MARZOUKA
8
2LFIG 2015-2016
III.b
TAp1 = 0
TAp2 = 40
TAp3 = 70
TAp4 = 140
Temps moyen d’exécution :
TMA= (0+40+70+140)/4 = 250/4 = 62.5
IV.a
FIFO + Chacun à son périphérique E/S
Wiçal BEN MARZOUKA
9
2LFIG 2015-2016
IV.b
RR (Q=5) + Chacun à son périphérique E/S
IV.c
RR (Q=5) + Même périphérique E/S
Wiçal BEN MARZOUKA
10