25
Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

Embed Size (px)

Citation preview

Page 1: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

Conceptos básicos de procesamiento en

procecesadores Intel® Multi Core

Page 2: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

2

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos

Tasa de Trabajos

• Cuántos trabajos se pueden ejecutar en un tiempo

Ejemplo Una señora puede tener un niño Una señora puede tener un niño en 9 mesesen 9 meses

Tasa de trabajos = 1 niño / 9 Tasa de trabajos = 1 niño / 9 mesesmesesTasa de trabajos = 0.111 niños por Tasa de trabajos = 0.111 niños por mesmes

Nueve señoras pueden tener 9 Nueve señoras pueden tener 9 niños en 9 mesesniños en 9 meses

Tasa de trabajos = 9 niños / 9 Tasa de trabajos = 9 niños / 9 mesesmesesTasa de trabajos = 1 niño por mesTasa de trabajos = 1 niño por mes

Page 3: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

3

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos

Tiempo de retorno

• Cuánto tiempo tarda un trabajo en terminarse

• Incluye el tiempo de espera

Ejemplo: Tiempo de retorno para cruzar una calleUn auto espera 180 segundos en el semáforo para Un auto espera 180 segundos en el semáforo para cruzar la avenidacruzar la avenida

Toma 5 segundos en cruzar la calleToma 5 segundos en cruzar la calleTiempo de retorno para cruzar la calle = 185 Tiempo de retorno para cruzar la calle = 185 segundossegundos

Page 4: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

4

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Plataformas para computación en paralelo

Diferentes arquitecturas

• SMP

• Hyper threading

• Multi core

Page 5: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

5

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Multi Core Vs Hyper Threading

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

Cache

Estado del CPU

Lógica de Interrupciones

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

CacheUnidades de

EjecuciónCache

Single Core

Multiprocesador (SMP)

Page 6: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

6

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Multi Core Vs Hyper Threading

Estado del CPU

Lógica de Interrupciones

Estado del CPU

Lógica de Interrupciones

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

Cache

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

CacheUnidades de

EjecuciónCache

Tecnología Hyper Threading

Multi Core

Page 7: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

7

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Multi Core Vs Hyper Threading

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

Cache

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

Cache

Estado del CPU

Lógica de Interrupciones

Estado del CPU

Lógica de Interrupciones

Unidades deEjecución

Cache

Estado del CPU

Lógica de Interrupciones

Multi Core con caché compartida

Multi Core con tecnología Hyper Threading

Page 8: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

8

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

¿Para que sirve tener dos o más núcleo en un CPU?

Aumentar tasa de trabajos

¿Qué tipo de trabajos?

•Trabajos que hacen uso intensivo del CPU

•Trabajos que requieren E/S

•Trabajos mixtos

Page 9: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

9

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Un trabajo en un nucleoUn trabajo en un nucleo

1 trabajo en 10 segundos1 trabajo en 10 segundos

Tasa = 1 / 10 = 0.1Tasa = 1 / 10 = 0.1

Tiempo de Tiempo de retorno =10 retorno =10 segssegs

10 segundos10 segundos

En el CPUEn el CPU

Page 10: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

10

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Dos trabajos en un nucleoDos trabajos en un nucleo

2 trabajos en 20 segundos2 trabajos en 20 segundos

Tasa = 2 / 20 = 0.1Tasa = 2 / 20 = 0.1

Tiempo de retorno P0 =20 Tiempo de retorno P0 =20 segssegs

Tiempo de retorno P1 =20 Tiempo de retorno P1 =20 segssegs

10 segundos10 segundos

10 segundos10 segundos

En el CPUEn el CPU

Page 11: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

11

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Con un CPU

•El tiempo de retorno aumenta

•La tasa de trabajos se mantiene

Page 12: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

12

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Dos trabajos en un nucleoDos trabajos en un nucleo

2 trabajos en 20 segundos2 trabajos en 20 segundos

Tasa = 2 / 20 = 0.1Tasa = 2 / 20 = 0.1

Tiempo de retornoTiempo de retornoP0 =15 segsP0 =15 segs Tiempo de retorno Tiempo de retorno

P1=19 segsP1=19 segs

El tiempo de retorno de El tiempo de retorno de los procesos puede los procesos puede variarvariar•PrioridadesPrioridades•Politicas de Politicas de platinificaciónplatinificación

La tasa de trabajos La tasa de trabajos se mantiene igualse mantiene igual

10 segundos10 segundos

10 segundos10 segundos

En el CPUEn el CPU

Page 13: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

13

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Un trabajo en dos nucleosUn trabajo en dos nucleos

1 trabajo en 10 segundos1 trabajo en 10 segundos

Tasa = 1 / 10 = 0.1Tasa = 1 / 10 = 0.1

Tiempo de Tiempo de retorno =10 retorno =10 segssegs

No hay mejora en No hay mejora en el tiempo de el tiempo de retorno ni la tasa retorno ni la tasa de trabajosde trabajos

Nucleo 0Nucleo 0

Nucleo 1Nucleo 1

10 segundos10 segundos

Page 14: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

14

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Desde el administrador de tareas

Page 15: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

15

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Dos trabajos en dos núcleosDos trabajos en dos núcleos

2 trabajos en 10 segundos2 trabajos en 10 segundosTasa = 2 / 10 = 0.2Tasa = 2 / 10 = 0.2

Tiempo de Tiempo de retorno =10 retorno =10 segssegs

La tasa de La tasa de trabajos aumenta trabajos aumenta al dobleal doble

El tiempo de retorno El tiempo de retorno se mantiene igual se mantiene igual que cuando que cuando ejecutamos un ejecutamos un trabajotrabajo

10 segundos10 segundos

10 segundos10 segundos

Nucleo 0Nucleo 0

Nucleo 1Nucleo 1

Page 16: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

16

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Multi core

Encontramos mejora en la tasa de trabajos y tiempo de retorno cuando ejecutamos dos procesos concurrentes.

Hasta ahora un solo proceso no es capaz de obtener beneficio de las arquitecturas MultiCore

Page 17: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

17

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Trabajos que hacen uso intensivo del CPU

Un trabajo optimizado en dos nucleosUn trabajo optimizado en dos nucleos

1 trabajo en 5 segundos1 trabajo en 5 segundos

Tasa = 1 / 5 = 0.2Tasa = 1 / 5 = 0.2

Tiempo de Tiempo de retorno =5 retorno =5 segssegs

10 segundos10 segundos

Nucleo 0Nucleo 0

Nucleo 1Nucleo 1

5 segundos5 segundos 5 segundos5 segundos

Hilo 0Hilo 0 Hilo 1Hilo 1

Page 18: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

18

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Definiendo los Hilos

Un hilo es una secuencia de instrucciones relacionadas que se ejecuta de forma independiente a otras secuencias

Todos los programas tienen al menos un hilo principal

• Inicializa el programa y comienza la ejecución de las instrucciones iniciales

• Puede crear otros hilos que ejecuten varias tareas o puede hacer todo el trabajo el solo

Page 19: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

19

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Dividiendo una aplicación en hilos

Un proceso puede dividirse en múltiples hilos

• Mejor uso de los recursos de hardware

Es necesario entender

• Diseño y estructura de la aplicación

• La interfase de programación con hilos

• El compilador y el ambiente de ejecución de la aplicación

• Las plataformas destino donde la aplicación se va a ejecutar

Page 20: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

20

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Estado del CPU

Lógica de Interrupciones

Cache

Unidades de ejecución

Hilos en plataformas single core

Single Core

InstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucción

InstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucción

Page 21: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

21

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Hilos en plataformas single core

Concurrencia

• Dos o más hilos se ejecutan en el mismo procesador

• El tiempo del procesador se divide dando turnos a los dos hilos de manera que pueden avanzar

Page 22: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

22

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Estado del CPU

Lógica de Interrupciones

Estado del CPU

Lógica de Interrupciones

Cache

Unidades de ejecución

Hilos en plataformas Hyper Threading

InstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucción

InstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucción

Tecnología Hyper Threading

Ambas instrucciones requieren diferentes unidades funcionales

Ambas instrucciones requieren una misma unidad funcional

Page 23: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

23

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Estado del CPU

Lógica de Interrupciones

Estado del CPU

Lógica de Interrupciones

Cache Cache

Unidades de ejecución Unidades de ejecución

Multi-hilos en plataformas multi core

InstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucción

InstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucciónInstrucción

Multi Core

Page 24: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

24

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.

Hilos en plataformas multi core

Paralelismo

• Dos o más hilos se ejecutan simultáneamente en dos o más procesadores

• Cada hilo tiene el tiempo de un procesador

Page 25: Conceptos básicos de procesamiento en procecesadores Intel® Multi Core

25

Copyright © 2006, Intel Corporation. All rights reserved.

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. *Other brands and names are the property of their respective owners.