Hilos Capítulo 5 Silberschatz Galvin. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.

Slides:



Advertisements
Presentaciones similares
Documentos de Construcción y Detalles
Advertisements

Los programas de Intel Educación son patrocinados por la Fundación Intel y la Corporación Intel. Derechos de autor © 2007, Corporación Intel. Todos los.
TEMA 1 Introducción a la Programación Concurrente
Los programas de Intel Educación son patrocinados por la Fundación Intel y la Corporación Intel. Derechos de autor © 2007, Corporación Intel. Todos los.
Hilos Capítulo 5 Silberschatz Galvin. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.
CI6060-V - Data Shortcut = archivos livianos [AutoCAD® Civil 3D] 1ra Parte: Concepto Jeremy Ramírez Hernández Ingeniero Aplicaciones SONDA® - Autodesk®
Copyright © 2009 Intel Corporation.
Administración de procesos y del procesador.
Lo que un usuario de Civil 3D necesita saber de MAP 3D y Raster Design (CI5831-V) Ing.Juan Carlos Serna A Division SIG - MicroCAD.
Sistemas Operativos Unidad II Procesos.
11 Servidores basados en Arquitectura Intel Junio 2008 DataWarehouses de Alto Rendimiento.
Estructuras en Sistemas Operativos
Administración de procesos y del procesador.
Planeación y Control de Producción (J06) Visión General Chile
HILOS Y COMUNICACIÓN ENTRE PROCESOS
Tema 10: Gestión de Memoria
INTEL CONFIDENTIAL Metodología de programación paralela Intel Software College.
Programación en los procecesadores Intel® Multi Core.
INTEL CONFIDENTIAL Paralelizando para mejorar el rendimiento con Intel® Threading Building Blocks Sesión:
Usando Tablas de Planificación y Espacios para Calcular Cargas de Calefacción con Autodesk® Revit MEP® 2012 Pedro Rivera Diseñador Mecánico/Coordinador.
Hilos - Lightweight process - Procesos ligeros
Software Sistemas Operativos
Estructura del sistema operativo
Profesor: Rodrigo Sanhueza Figueroa
Tema 10.3: Asignación de Espacio No Contiguo. Tema 10.3: 2 Silberschatz, Galvin and Gagne ©2005 Fundamentos de los Computadores (ITT, Sist. Electr.),
Asignación de Espacio No Contiguo
Sistemas Operativos II MC. Daniel Fajardo Delgado INSTITUTO TECNOLÓGICO DE CD. GUZMÁN 24 de Abril de 2004.
Programando con Hilos de Windows* Intel Software College.
Hebras Cecilia Hernández. Qué es un proceso? Consiste Espacio de direccionamiento Código a ejecutar Datos estáticos y dinámicos Pila o stack CPU: PC,
Hilos En La Computación. (THREADS).
Programación con OpenMP* Intel Software College. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or.
Programming with POSIX* Threads Intel Software College.
Sistema operativo libre vs propietario
Patrones de Programación Paralela Sesión:. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.
Los programas de Intel Educación son patrocinados por la Fundación Intel y la Corporación Intel. Derechos de autor © 2007, Corporación Intel. Todos los.
Estructuras en Sistemas Operativos DAISY KATERINE RODRÍGUEZ.
Teoría de Sistemas Operativos Procesos Departamento de Electrónica 2º Semestre, 2003 Gabriel Astudillo Muñoz
Conceptos básicos de procesamiento en procecesadores Intel® Multi Core.
Gestión de Memoria.
SISTEMAS OPERATIVOS 1.4 CLASIFICACIÓN DE LOS S.O
Compiladores Intel 9.x en el procesador Intel® Core Duo™ Windows version Intel Software College.
Introducción a los SOs.
Tema 8: Introducción a los SOs. Tema 8: 2 Silberschatz, Galvin and Gagne ©2005 Fundamentos de los Computadores (ITT, Sist. Electr.), Introducción.
Integrante: Yohandry Cueto Carnet: # Contenido Kernel Linux Limitaciones del Kernel Linux Kernel Mach Que es Hurd Arquitectura Ventajas Distribuciones.
CONCEPTOS FUNDAMENTALES DEL NIVEL DEL SISTEMA OPERATIVO
Sistemas Distribuidos
Programando con Hilos POSIX* Intel Software College.
Sistemas Operativos Unidad III Procesos.
Gestión de Memoria.
FLOR ALBA ACEVEDO COD JENNIFFER TATIANA TORRES COD
Unidad 2 – Gestión de Procesos
Derechos de autor © 2008, Corporación Intel. Todos los derechos reservados. Intel e Intel  Educación son marcas comerciales o marcas registradas de la.
PROCESOS PROCESOS, HILOS, COMUNICACIÓN ENTRE PROCESOS Y PLANIFICACIÒN
Introducción a VTune™ Analizador de rendimiento
Programación de Clientes Especialidad en Base de Datos.
SISTEMAS OPERATIVOS Son un conjunto de programas destinados a permitir la comunicación entre el usuario y en computador y gestionar sus recursos.
Estructuras en Sistemas Operativos DAISY KATERINE RODRÍGUEZ.
Derechos de autor © 2008, Corporación Intel. Todos los derechos reservados. Intel e Intel  Educación son marcas comerciales o marcas registradas de la.
Derechos de autor © 2008, Corporación Intel. Todos los derechos reservados. Intel e Intel  Educación son marcas comerciales o marcas registradas de la.
ELEMENTO DE COMPETENCIA 3
También es conocido como proceso ligero. Es una entidad básica de utilización de CPU y esta formado por un contador de programa, algunos registros y una.
PROCESADOR.- El procesador es el cerebro del sistema, encargado de procesar toda la información. Básicamente, es el "cerebro" de la computadora. Prácticamente,
Desarrollador Profesional de Juegos Programación III Unidad II Hilos de ejecución Threads.
CAPITULO III El Sistema Operativo (OS)
Threads Introducción Modelos Multi-Threading Problemas con Threads Pthreads Threads en Solaris 2 Threads en Windows 2000 Threads en Linux Threads en Java.
Procesos Un proceso es un programa en ejecución. Modelo de procesos secuenciales. Abstracción del SO.
Administración de Memoria Conceptos Swapping Asignación Continua Paginación Segmentación Segmentación con Paginación.
Estructura del sistema operativo
Capítulo 5 Silberschatz Galvin
Hilos de Procesamiento. Hilos Concepto Beneficios Hilos a nivel kérnel y a nivel usuario Modelos multihilos Hilos de Solaris 2 Hilos de Java.
Transcripción de la presentación:

Hilos Capítulo 5 Silberschatz Galvin

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. Hilos2 Sistemas Operativos Hilos Concepto Beneficios Hilos a nivel kérnel y a nivel usuario Modelos multihilos Hilos de Solaris 2 Hilos de Java

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. Hilos3 Sistemas Operativos Hilos Un hilo (o proceso ligero) es una unidad básica de utilización del CPU; consiste de: Contador de programa Conjunto de registros Espacio de stack

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. Hilos4 Sistemas Operativos Hilos Un hilo comparte con sus hilos pares: Sección de código Sección de datos Recursos del sistema operativo En conjunto se les conoce como proceso Un proceso tradicional o pesado, es igual a una tarea con un hilo.

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. Hilos5 Sistemas Operativos un proceso un hilo varios procesos un hilo por proceso varios procesos varios hilos por proceso un proceso varios hilos Hilos y procesos

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. Hilos6 Sistemas Operativos Código Datos Archivos Código Datos Archivos Hilo Hilos Mono-hilo Multi-hilo Procesos con un solo hilo y con múltiples hilos

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. Hilos7 Sistemas Operativos Bloque de control del hilo Stack del usuario Stack del usuario Stack del kernel Stack del Kernel Espacio de direcciones del usuario Espacio de direcciones del usuario Bloque de control del proceso Bloque de control del proceso Hilo Modelo de proceso de un solo hilo Modelo de proceso multihilos Bloque de control del hilo Stack del usuario Stack del kernel Hilo Bloque de control del hilo Stack del usuario Stack del kernel Hilo Modelos de procesos de un solo hilo y de muchos hilos

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. Hilos8 Sistemas Operativos Multihilo Sistema operativo que mantiene varios hilos de ejecución dentro de un mismo proceso. MS-DOS soporta un solo hilo. UNIX soporta múltiples procesos de usuarios, pero sólo un hilo por proceso. Windows 2000, Solaris, Linux, Mac OS, OS/2 soportan múltiples hilos.

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. Hilos9 Sistemas Operativos Hilos En una tarea donde hay múltiples hilos, mientras un hilo servidor está bloqueado y esperando, otro hilo en la misma tarea puede ejecutarse. Cooperación de múltiples hilos en la misma tarea aumenta la tasa de trabajos por unidad tiempo y mejora el rendimiento. Aplicaciones que requieren compartir un buffer común (productor-consumidor) sacan provecho de la utilización de hilos.

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. Hilos10 Sistemas Operativos Hilos Los hilos proveen un mecanismo que permiten a procesos secuenciales hacer llamadas bloqueantes mientras otros en paralelo ejecutan otras operaciones.

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. Hilos11 Sistemas Operativos Beneficios Compartición de recursos Economía Utilización de arquitecturas de múltiples procesadores

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. Hilos12 Sistemas Operativos Hilos a nivel usuario El manejo de los hilos lo hace una librería de hilos a nivel usuario Ejemplos - Hilos POSIX - Mach C-threads - Hilos de Solaris

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. Hilos13 Sistemas Operativos Hilos a nivel usuario (un CPU con dos núcleos) Nivel kérnel (sistema operativo) Nivel usuario Proceso de usuario gestiona y planifica los múltiples hilos Core CPU Hardware Planificador del SO

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. Hilos14 Sistemas Operativos Ventajas de los hilos a nivel usuario Los hilos podían implementarse en las aplicaciones que se ejecutaban en sistemas operativos que no son capaces de planificar hilos Ejemplo: Primeras implementaciones de UNIX

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. Hilos15 Sistemas Operativos Desventajas de los hilos a nivel usuario El planificador del sistema operativo solo ve un hilo por proceso  No ve los hilos a nivel usuario  Usa un solo núcleo del procesador en un procesador que tiene más de un núcleo  No puede distribuir los hilos a nivel el usuario en los dos núcleos

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. Hilos16 Sistemas Operativos Hilos a nivel kérnel Soportados por el kérnel Ejemplos Windows 95/98/NT Solaris Linux Mac OS

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. Hilos17 Sistemas Operativos Hilos a nivel kernel (con un CPU con un solo núcleo) Nivel kérnel (sistema operativo) Nivel usuario Core CPU Hardware Planificador del SO

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. Hilos18 Sistemas Operativos Hilos a nivel kernel (con un CPU con doble núcleo) Nivel kérnel (sistema operativo) Nivel usuario Core CPU Hardware Planificador del SO

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. Hilos19 Sistemas Operativos Ventajas de los hilos a nivel kérnel El proceso de usuario no se tiene que encargar de la planificación de los hilos Si tenemos un procesador con más de un núcelo, el Sistema operativo puede planificar los hilos en diferentes núcleos

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. Hilos20 Sistemas Operativos Modelos multihilos Muchos a uno Uno a uno Muchos a muchos

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. Hilos21 Sistemas Operativos Muchos a uno Muchos hilos a nivel usuario mapeados a un hilo a nivel kérnel. Usado en sistemas que no soportan hilos a nivel kérnel.

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. Hilos22 Sistemas Operativos Modelo muchos a uno k k

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. Hilos23 Sistemas Operativos Ejecución Listo Relaciones entre estados de ULTs y estados de procesos Ejecución Bloqueado Listo Ejecución Bloqueado Hilo 1 Hilo 2 Proceso B Kernel Usuario

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. Hilos24 Sistemas Operativos Uno a uno Cada hilo a nivel usuario corresponde a un hilo del kérnel. Ejemplos: - Windows 95/98/NT - OS/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. Hilos25 Sistemas Operativos Modelo uno a uno k k k k k k k k Hilo a nivel usuario Hilo a nivel kérnel

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. Hilos26 Sistemas Operativos Modelo muchos a muchos k k k k k k Hilo a nivel usuario Hilo a nivel kérnel

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. Hilos27 Sistemas Operativos Usuario Núcleo Hardware Biblioteca de hilos Hilo a nivel de usuario Hilo del núcleo Proceso ligero Procesador LLLLLLLLL L P PPPPP Proceso 1 Proceso 2Proceso 3Proceso 4Proceso 5 Ejemplo de la arquitectura multihilo de Solaris Establecer Afinidad

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. Hilos28 Sistemas Operativos Gestión de hilos básica Un hilo tiene : Un identificador (ID) Una pila Una prioridad de ejecución Una dirección de inicio de ejecución.

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. Hilos29 Sistemas Operativos Gestión de hilos básica (POSIX) Se dice que un hilo es dinámico si se puede crear en cualquier instante durante la ejecución. En POSIX : los hilos se crean dinámicamente con la función pthread_create. pthread_exit termina el hilo que la invoca.

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. Hilos30 Sistemas Operativos Gestión de hilos básica (POSIX), ejemplo: Programa que crea un hilo donde muestra el mensaje “Hola Mundo” Para compilar el programa : $ cc -D_REENTRANT thread2.c -o thread2 -lpthread

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. Hilos31 Sistemas Operativos int main() { pthread_create(a_thread,funcion_hilo); pthread_join(a_thread); } funcion_hilo() { … } Crea un hilo nuevo Espera a que termine el hilo creado Hilo principal Hilo creado con la llamada pthread_create

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. Hilos32 Sistemas Operativos Gestión de hilos básica (POSIX) Pthread_join() Hilo que ejecuta pthread_join, espera a que termine otro hilo El hilo principal debe esperar a que terminen todos los hilos creados Si el hilo principal no espera a que terminen los hilos creados, al terminar termina el proceso con todos los hilos.

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. Hilos33 Sistemas Operativos