Added scheduling exercise.
This commit is contained in:
		
							
								
								
									
										86
									
								
								1/ISO/notes/ejercicio2planificacion.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								1/ISO/notes/ejercicio2planificacion.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,86 @@
 | 
				
			|||||||
 | 
					# Ej1
 | 
				
			||||||
 | 
					Proc.      Dur.      Entr.
 | 
				
			||||||
 | 
					P1         5         0
 | 
				
			||||||
 | 
					P2         5         1
 | 
				
			||||||
 | 
					P3         2         3
 | 
				
			||||||
 | 
					P4         1         4
 | 
				
			||||||
 | 
					P5         5         5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FCFS: non-preemptive
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| 14| 15| 16| 17|
 | 
				
			||||||
 | 
					----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					P1 | R | R | R | R | R |
 | 
				
			||||||
 | 
					P2 |   | B | B | B | B | R | R | R | R | R |
 | 
				
			||||||
 | 
					P3 |   |   |   | B | B | B | B | B | B | B | R | R |
 | 
				
			||||||
 | 
					P4 |   |   |   |   | B | B | B | B | B | B | B | B | R |
 | 
				
			||||||
 | 
					P5 |   |   |   |   |   | B | B | B | B | B | B | B | B | R | R | R | R | R |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					a) ¿Cuál es el tiempo de espera de cada proceso?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					P1: 0  P2: 4  P3: 7  P4: 8  P5: 8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					b) Indica el tiempo medio de espera de los procesos.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(0 + 4 + 7 + 8 + 8) / 5 = 5.4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					c) El proceso 4 ¿puede estar contento con esta planificación?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					No, ya que es un proceso muy corto, y tiene que esperar 8 ciclos para correr
 | 
				
			||||||
 | 
					durante un solo ciclo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					d) Si el proceso 1 y cuatro se intercambiasen en el orden de llegada,
 | 
				
			||||||
 | 
					¿mejorarían los tiempos de espera?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| 21|
 | 
				
			||||||
 | 
					--------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					P4 | R |
 | 
				
			||||||
 | 
					P2 |   | B | B | B | B | R | R | R | R | R |
 | 
				
			||||||
 | 
					P3 |   |   |   | B | B | B | B | B | B | B | R | R |
 | 
				
			||||||
 | 
					P1 |   |   |   |   | B | B | B | B | B | B | B | B | R | R | R | R | R |
 | 
				
			||||||
 | 
					P5 |   |   |   |   |   | B | B | B | B | B | B | B | B | B | B | B | B | R | R | R | R | R |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Empeoraría los tiempos de espera, ya que ahora el P5 tiene que esperar más para
 | 
				
			||||||
 | 
					correr.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Ej2
 | 
				
			||||||
 | 
					Proc.   Dur.   Entr.
 | 
				
			||||||
 | 
					P1      7      0
 | 
				
			||||||
 | 
					P2      4      2
 | 
				
			||||||
 | 
					P3      1      4
 | 
				
			||||||
 | 
					P4      4      5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SJF: Non-preemtive
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| 14| 15|
 | 
				
			||||||
 | 
					P1 | R | R | R | R | R | R | R |
 | 
				
			||||||
 | 
					P2 |   |   | B | B | B | B | B | B | R | R | R | R |
 | 
				
			||||||
 | 
					P3 |   |   |   |   | B | B | B | R |
 | 
				
			||||||
 | 
					P4 |   |   |   |   |   | B | B | B | B | B | B | B | R | R | R | R |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					a) ¿Cuál es el tiempo de espera de cada proceso?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					P1: 0  P2: 6  P3: 3  P4: 7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					b) Indica el tiempo medio de espera de los procesos.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(0 + 6 + 3 + 7) / 4 = 4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					c) El proceso 4 ¿puede estar contento con esta planificación?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Debería estarlo, porque llega a un momento apropiado tanto por su ciclo de
 | 
				
			||||||
 | 
					entrada, como por su duración.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					d) Si el proceso 1 y 4 se intercambiasen en el orden de llegada,
 | 
				
			||||||
 | 
					¿mejorarían los tiempos de espera?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| 14| 15|
 | 
				
			||||||
 | 
					P4 | R | R | R | R |
 | 
				
			||||||
 | 
					P2 |   |   | B | B | B | R | R | R |
 | 
				
			||||||
 | 
					P3 |   |   |   |   | R |
 | 
				
			||||||
 | 
					P1 |   |   |   |   |   | B | B | B | R | R | R | R | R | R | R |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Mejoraría, ya que sólo habría 6 ciclos de espera en total con media de 1.5.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Ej3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Reference in New Issue
	
	Block a user