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
Cable & Wireless Panamá. Entrar a Inicio, Programas y buscar Windows Live.
Advertisements

Metodología de programación paralela
Programación Multi-core: Conceptos básicos
E-science grid facility for Europe and Latin America CeCalCULA Ambientes y Herramientas para la e-Investigación Mérida, Portales.
Como Configurar el Internet
Windows Presentation Foundation
PLEASE READ (hidden slide) This template uses Microsofts corporate font, Segoe Segoe is not a standard font included with Windows, so if you have not.
Quality Management (J07) Overview Argentina
111 © 2002, Cisco Systems, Inc. All rights reserved. Presentation_ID.
Bases de Datos Espaciales SPATIAL QUERY LANGUAGES
Arquitectura de Computadores I
PIPELINING - INTRODUCCION
ARQUITECTURA DE COMPUTADORES - PIPELINING
A Study of Internet Instant Messaging and Chat Protocols
Programando con Hilos POSIX* Intel Software College.
Programación con OpenMP* Intel Software College. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or.
Programando con Hilos de Windows* Intel Software College.
Corrigiendo Errores de Paralelización con Intel® Thread Checker para Hilos Explícitos Intel Software College.
Desarrollo de proyectos WEBDiseño de Interaccion Dise ñ o WEB Extraído de: Ray, K y Amy, S. (1998). Diseño interactivo. España, Anaya Multimedia.
Unidad 7 Manejo de Archivos Copyright © 2005.
Lenguajes de Programación Soluciones a pruebas de nivel
INTEGRIDAD, INTEGRIDAD REFERENCIAL
Examen FRAD Empezar. 1. ¿Cu á l es la diferencia entre FRAD y FRANAR? 1.FRAD son las siglas de un grupo de trabajo de OCLC y FRANAR las siglas de un grupo.
Microsoft Office Power Point, es una herramienta que nos proporciona Microsoft, para editar presentaciones graficas, de tal forma que se nos feliciten.
SERVICIOS A TRAVES DE CABLE MODEM El servicio más popular es sin duda el acceso a Internet a alta velocidad y el empleo del correo electrónico. Este servicio.
Servicios De Internet.. Integrantes: Gemma Cedillo Saucedo Delia Alejandra Castillo Almazán Jorge Alberto Arregoytia Garcia Adriana Lara Mata Aleida Villegas.
ADELACU Graballo Graballo Adelacu Ltda. AVIZA Grab all Integración con Collaboration Suite.
Prof. Juan Carlos Lima Colegio IPTCE. Antes de comenzar: ¿Qué es una red informática? ¿Qué ventajas tiene instalar una red informática? ¿Qué servicios.
EPI-Control Programa para la Vigilancia Epidemiológica Hospitalaria Ampliada y el Control de Infecciones Versión 7.0 Contacto Teléfono.
Instrumentación Industrial
LUIS GONZALES SÁNCHEZ RESPONSABLE PROCESO DE REGISTRO DE DNI DE ESTUDIANTES UNIDAD DE GESTIÓN EDUCATIVA LOCAL LAMAS UNIDAD EJECUTORA 305.
Base de datos y Microsoft Access
Entrada y salida Fundamentos de programación/Programación I
EL SISTEMA OPERATIVO Presentación realizada por Virgilio Marco Aparicio Profesor de Apoyo al Área Práctica. IES Tiempos Modernos. ZARAGOZA.
Visual basic Curso de Habilitación Laboral IV. ¿Qué es Visual Basic Visual Basic es uno de los tantos lenguajes de programación que podemos encontrar.
ADMINISTRACION DE ARCHIVOS & ENTORNO DE WINDOWS
Descarga: En la pagina principal usted podra descargar el programa Skype : DIAPOSITIVA 1 Clic para Descargar El programa Clic para Descargar El instructivo.
Autodesk INVENTOR 2010.
CENTRO DE BACHILLERATO TECNOLOGICO INDUSTRIAL Y DE SERVIVCIOS No 3
CONSTRUCCIÓN Y ARQUITECTURA DEL SOFTWARE
¿Qué es la web 2.0 Web 2.0 y educación Tipos de herramientas web 2.0 Herramientas y ejemplos de aplicación ¿Dónde buscar aplicaciones Web 2.0?
HISTORIA DE LA COMPUTADORA Es el resultado evolutivo de ideas y realizaciones de muchas personas relacionadas con áreas tales como la electrónica, la.
Informática Extracurricular Universidad Nacional Arturo Jauretche.
O Skydrive o Características Características o Privacidad Privacidad o App App o Ventajas Ventajas o Desventajas Desventajas o Movie Maker Movie Maker.
Procedimientos Almacenados y Disparadores
Corrigiendo Errores en la Paralelización con Intel® Parallel Inspector.
Introducción al VHDL VHDL orientado a la síntesis de circuitos en Dispositivo Lógicos Programables.
PL/SQL Francisco Moreno Universidad Nacional. Funciones Si un procedimiento tiene solo un parámetro de salida, se puede remplazar por una función y esta.
ExpoForo 2008 "Políticas Públicas em la era digital" Camillo Speroni VP & GM Novell Latin America
Entender qu é es cloud computing Cloud computing seg ú n Microsoft: Azure.NET Services SQL Services Live Services.
Copyright © 2008, Solid Quality Mentors. All rights reserved. PerformancePoint Server Implementar una solución PPS-Monitoring Pablo Ahumada Koschitzky.
Antonio Gámir TSP – Windows Client Microsoft Ibérica.
Su Negocio Conectado. VisibilidadVisibilidad ColaboraciónColaboración PlanificaciónPlanificación EjecuciónEjecución Build Connections.
para desarrolladores Minimizar el cambio Concentrarse en estabilidad, confiabilidad y rendimiento. Ayudar a mejorar la productividad Reducir la curva.
11 Servidores basados en Arquitectura Intel. 2 * Other names and brands may be claimed as the property of others. Copyright © 2008, Intel Corporation.
SOA conference. Qué es WCF Fundamentos de la Arquitectura WCF Adaptadores BizTalk WCF Novedades en BizTalk Demo.
Herramientas de Oracle para realizar Tuning de Sentencias SQL
1 AA-DG/MKC | 03/2012 | © Robert Bosch GmbH All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution,
Middleware Java 2 Enterprise Edition
INTEL CONFIDENTIAL Metodología de programación paralela Intel Software College.
Programación en los procecesadores Intel® Multi Core.
Conceptos básicos de procesamiento en procecesadores Intel® Multi Core.
Hilos Capítulo 5 Silberschatz Galvin. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.
Capítulo 5 Silberschatz Galvin
Procesos Concurrentes
PROCESOS COMENZAR.
– GESTIÓN DE PROCESOS Sistemas Operativos. AGENDA Concepto de Proceso Planificación de Procesos Operaciones entre Procesos Comunicación interprocesos.
Axcel Sting Anchante Mosayhuate.. Qué aspecto tienen los sistemas operativos por fuera (es decir, la interfaz con el programador), ha llegado el momento.
ESTRUCTURA DE LOS SISTEMAS OPERATIVOS. Estos sistemas no tienen una estructura definida, sino que son escritos como una colección de procedimientos donde.
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 tarea 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 Soporte de hilos en Solaris 2 Solaris 2 es una versión de UNIX con soporte para hilos a nivel kernel y a nivel usuario, procesamiento simétrico y planificación en tiempo real.

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 Soporte de hilos en Solaris 2 LWP – Nivel intermedio entre los hilos a nivel kernel y los hilos a nivel 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. Hilos29 Sistemas Operativos Hilos en Solaris 2. Recursos necesarios para los tipos de hilos Hilos del kernel Estructura de datos pequeña y un stack El intercambio de hilos no requiere cambiar la información del acceso a memoria Cambios de hilos relativamente rápidos

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 Hilos en Solaris 2. Recursos necesarios para los tipos de hilos LWP PCB con datos de los registros Información sobre la memoria El intercambio entre LWP es relativamente lento

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 Hilos en Solaris 2. Recursos necesarios para los tipos de hilos Hilos a nivel usuario Solo requiere un stack y un contador de programa No involucrar al kernel significa un intercambio rápido El kernel solo ve los LWP que soporta los hilos a nivel 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. Hilos32 Sistemas Operativos Ejemplo de la arquitectura multihilo 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. Hilos33 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. Hilos34 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. Hilos35 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. Hilos36 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. Hilos37 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. Hilos38 Sistemas Operativos Hilos en memoria Código (compartido) Datos (compartidos) Int cont=0 (var. Global) Stack (de cada hilo) Int i (var local) Stack (de cada hilo) Int i (var local)