Programando con Hilos POSIX* Intel Software College.

Slides:



Advertisements
Presentaciones similares
Cable & Wireless Panamá. Entrar a Inicio, Programas y buscar Windows Live.
Advertisements

Documentos de Construcción y Detalles
Autodesk® Revit® Structure Software Interfaz del Usuario
Análisis Estructural Avanzado y Coordinación
FUNDAMENTALS OF THE JAVA PROGRAMMING LANGUAGE
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.
Metodología de programación paralela
Programación Multi-core: Conceptos básicos
Como Configurar el Internet
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.
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.
Quality Management (J07) Overview Argentina
A la izquierda A la derecha Todo recto
Unlike English, Spanish has two words that mean for: por and para
In both English and Spanish, the verb to be (ser) and numbers are used to tell time. Copyright © 2008 Vista Higher Learning. All rights reserved.
Copyright © 2008 Vista Higher Learning. All rights reserved Indefinite words refer to people and things that are not specific, for example, someone.
El 8 de septiembre jueves Calentamiento
Negative words deny the existence of people and things or contradict statements, for instance, no one or nothing. Spanish negative words have corresponding.
¿Quién es este hombre muy importante? ¿Por qué cada niño en cada escuela de Cuba le conoce?
You will now learn how to form and use the past subjunctive (el pretérito imperfecto de subjuntivo), also called the imperfect subjunctive. Like the present.
Both Spanish and English use the present progressive, which consists of the present tense of the verb to be and the present participle (the -ing form in.
Copyright © 2008 Vista Higher Learning. All rights reserved In the previous lesson, you learned how to use the subjunctive with expressions of will.
Remember present tense –AR verbs… Copyright © 2008 Vista Higher Learning. All rights reserved
Copyright © 2008 Vista Higher Learning. All rights reserved En español hay dos palabras que significan for: Por y Para. Estas dos preposiciones no.
Programación con OpenMP* Intel Software College. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or.
Hilos Capítulo 5 Silberschatz Galvin. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.
Programando con Hilos de Windows* Intel Software College.
Corrigiendo Errores de Paralelización con Intel® Thread Checker para Hilos Explícitos Intel Software College.
Ejemplo de Programa C++
CI6060-V - Data Shortcut = archivos livianos [AutoCAD® Civil 3D] 1ra Parte: Concepto Jeremy Ramírez Hernández Ingeniero Aplicaciones SONDA® - Autodesk®
ALC 11 lunes el 26 de septiembre. Bienvenida lunes el 26 de septiembre Front row face the back row. Back row will read the words on the screen in the.
Corrigiendo Errores en la Paralelización con Intel® Parallel Inspector.
Modelo Informatizado de Edificios (BIM)
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
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 IT Essentials PC Hardware and Software 4.1 Instructional Resource Chapter.
Español II Srta. Forgue El 11 de abril de La clase de hoy El 11 de abril Ahora mismo: Mirar el tutorial de 7.1 Repaso: Corregir INTÉNTALO en la.
Srta. Forgue El 29 de enero de 2011
Srta. Forgue El 14 de febrero
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.
INFORMATICA I Funciones CLASE 13.
Transformaciones que conservan ángulos
Seminario de Lenguajes A – Opción Ada Seminario de Lenguajes A – Opción Ada – Raúl Champredonde1 Overloading de subprogramas procedure Put(Item: in integer;
Aplicaciones Multihilo
C++ vs C Los códigos de C++ están copiados de la documentación de PRO1.
La hora Telling time in Spanish. Asking what time it is The question is: “¿Qué hora es?” To answer, say: “Son las ____: ____” for everything except times.
1 DEFINITION OF A CIRCLE and example CIRCLES PROBLEM 1a PROBLEM 2a Standard 4, 9, 17 PROBLEM 1b PROBLEM 2b PROBLEM 3 END SHOW PRESENTATION CREATED BY SIMON.
Las Estaciones y El Tiempo Day 6 H AGA A HORA 21 de agosto Translate the following times to Spanish: Translate the following times to Spanish: It’s one.
THOMSON SCIENTIFIC Updates for April Copyright 2006 Thomson Corporation 2 2 Actualizaciones Actualizaciones a las herramientas Refine y Analyze.
1 Chapter 8 Scope Dale/Weems/Headington. 2 Tópicos del Capítulo 8 l Local Scope vs. Global Scope of an Identifier l Detailed Scope Rules to Determine.
iLogic - Automatización Inteligente para Diseño Mecánico e Industrial
Copyright © 2008 Vista Higher Learning. All rights reserved  In Spanish, as in English, the object of a preposition is the noun or pronoun that.
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:
Autodesk Revit© + 3D Scan para Modelado y Revisión de Proyectos
© 2011 Autodesk MA5584 – V No mas CV’s y curvas rebeldes… Tips que usted Debe Conocer Para Lograr Superficies Perfectas Martin Carcaño MFG Technical Specialist.
Programando con Hilos de Windows* Intel Software College.
Programming with POSIX* Threads Intel Software College.
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.
Conceptos básicos de procesamiento en procecesadores Intel® Multi Core.
Programando con Hilos POSIX* Intel Software College.
Derechos de autor © 2008, Corporación Intel. Todos los derechos reservados. Intel e Intel  Educación son marcas comerciales o marcas registradas de la.
Empleando apuntadores una función puede entregar múltiples resultados / /Esta función no funciona #include void intercambiaValores(float a, float b) {
Hilos Capítulo 5 Silberschatz Galvin. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.
Diagramas de tuberías 3D usando Autodesk® Revit MEP® 2012
Transcripción de la presentación:

Programando con Hilos POSIX* Intel Software College

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. 2 Programming with POSIX* Threads Objetivos Explorar las funciones de la librería Pthreads para crear y sincronizar 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. 3 Programming with POSIX* Threads ¿Qué son los pthreads? Estándar POSIX.1c Interfaz en lenguaje C Los hilos existen dentro del mismo proceso Todos los hilos son pares No es un modelo explícito padre-hijo Excepto: main thread contiene toda la información del proceso

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. 4 Programming with POSIX* Threads pthread_create int pthread_create(tid, attr, function, arg); pthread_t *tid descriptor del hilo creado const pthread_attr_t *attr atributos del hilo a crearse void *(*function)(void *) función que será mapeada al hilo void *arg argumento que se envía a la funció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. 5 Programming with POSIX* Threads pthread_create Detalles Inicia un hilo ejecutando la función Descriptor del hilo retornado por medio de la estructura pthread_t Especifica NULL para usar los atributos por default Un solo argumento enviado a la función Si no tiene argumentos, especifica NULL Verificar códigos de error! EAGAIN – recursos insuficientes para crear el hilo EINVAL – atributo inválido

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. 6 Programming with POSIX* Threads Eejemplo: Creación del hilo #include void *hello (void * arg) { printf(Hello Thread\n); } main() { pthread_t tid; pthread_create(&tid, NULL, hello, NULL); } ¿Qué sucede?

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. 7 Programming with POSIX* Threads Esperando un Thread int pthread_join(tid, val_ptr); pthread_t tid manejador de un hilo a esperar void **val_ptr valor de salida devuelto por 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. 8 Programming with POSIX* Threads pthread_join Detalles Un hilo espera a que un hilo con descriptor tid termine Solo espera a que un hilo se una El hilo debe ser unible Un valor de salida se devuelve del hilo unido Tipo devuelto es (void *) Usar NULL si no se espera un valor de retorno ESRCH - hilo (pthread_t) no encontrado EINVAL - hilo (pthread_t) no unible

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. 9 Programming with POSIX* Threads Estados de un hilo Los hilos Pthread tienen dos estados Unible (joinable) Desacoplado (detached) Por default los hilos son unibles Los recursos se mantienen hasta el pthread_join Pueden ser reseteados con atributos o una llamada API Los hilos desacoplados no pueden unirse Los recursos pueden reclamarse en la terminación No se pueden resetear a ser unibles

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. 10 Programming with POSIX* Threads Ejemplo: Múltiples Hilos #include #define NUM_THREADS 4 void *hello (void *arg) { printf(Hello Thread\n); } main() { pthread_t tid[NUM_THREADS]; for (int i = 0; i < NUM_THREADS; i++) pthread_create(&tid[i], NULL, hello, NULL); for (int i = 0; i < NUM_THREADS; i++) pthread_join(tid[i], NULL); }

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. 11 Programming with POSIX* Threads ¿Qué falla? ¿Qué se muesta de myNum? void *threadFunc(void *) { void *threadFunc(void *pArg) { int* p = (int*)pArg; int* p = (int*)pArg; int myNum = *p; printf( Thread number %d\n, myNum);}... // from main(): for (int i = 0; i < numThreads; i++) { pthread_create(&tid[i], NULL, threadFunc, &i); pthread_create(&tid[i], NULL, threadFunc, &i);}

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. 12 Programming with POSIX* Threads for(int i=0;i<numThreads;i++) { pthread_create(&tid[i], NULL, thread, (void *) &i); } void *thread(void *pArg) { int *p =(int *) arg; int mynum = *p; printf(…….. %d\n",mynum); pthread_exit(NULL); } i=0x pArg=0x p=0x000100C mynum=0x x Contenido de la dirección 0x

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. 13 Programming with POSIX* Threads Solución – Almacenamiento Local void *threadFunc(void *) void *threadFunc(void *pArg){ (int*)pArg) int myNum = *((int*)pArg); printf( Thread number %d\n, myNum);}... // from main(): for (int i = 0; i < numThreads; i++) { tNum[i] = i; tNum[i] = i; pthread_create(&tid[i], NULL, threadFunc, &tNum[i]); pthread_create(&tid[i], NULL, threadFunc, &tNum[i]);}

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. 14 Programming with POSIX* Threads Pthreads Variables Mutex Simple, flexible, y eficiente Permiten estructuras de programación correctas para evitar condiciones de concurso Nuevos tipos pthread_mutex_t Variable mutex pthread_mutexattr_t Atributos de mutex Antes de usar, mutex debe ser inicializada

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. 15 Programming with POSIX* Threads pthread_mutex_init int pthread_mutex_init( mutex, attr ); pthread_mutex_t *mutex mutex a ser inicializada const pthread_mutexattr_t *attr atributos a ser establecidos a mutex ENOMEM – memoria insuficiente para mutex EAGAIN – recursos insuficientes (otros que no son memoria) EPERM - no privilegios para ejecutar la operació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. 16 Programming with POSIX* Threads Inicialización Alternativa Puede usarse el inicializador estático PTHREAD_MUTEX_INITIALIZER Usa los atributos por default El programador debe poner atención al alcance de los mutex Deben ser visibles a los hilos pthread_mutex_t mtx1 = PTHREAD_MUTEX_INITIALIZER;

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. 17 Programming with POSIX* Threads pthread_mutex_lock int pthread_mutex_lock( mutex ); pthread_mutex_t *mutex mutex que intenta hacer el lock

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. 18 Programming with POSIX* Threads pthread_mutex_lock Detalles Intenta hacer el lock del mutex Si el mutex está bloqueado por otro hilo, el hilo que llama al lock se bloquea Mutex es detenido por el hilo que lo llama hasta que se desbloquea Mutex lock/unlock deben ser pares, si no puede ocurrir un interbloqueo EINVAL - mutex invalido EDEADLK – el hilo llamante ya es dueño del mutex

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. 19 Programming with POSIX* Threads pthread_mutex_unlock int pthread_mutex_unlock( mutex ); pthread_mutex_t *mutex mutex a ser desbloqueado EINVAL - mutex es inválido EPERM - el hilo llamante no es dueño del mutex

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. 20 Programming with POSIX* Threads Exjemplo: Uso del mutex #define NUMTHREADS 4 pthread_mutex_t gMutex; // ¿porque debe ser global? int g_sum = 0; void *threadFunc(void *arg) { int mySum = bigComputation(); pthread_mutex_lock( &gMutex ); g_sum += mySum; // los hilos acceden uno a la vez pthread_mutex_unlock( &gMutex ); } main() { pthread_t hThread[NUMTHREADS]; pthread_mutex_init( &gMutex, NULL ); for (int i = 0; i < NUMTHREADS; i++) pthread_create(&hThread[i],NULL,threadFunc,NULL); for (int i = 0; i < NUMTHREADS; i++) pthread_join(hThread[i]); printf (Global sum = %f\n, g_sum); }

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. 21 Programming with POSIX* Threads Variables Condición Los semáforos son condicionales en el contador del semáforo Las variables condición están asociadas con una condición arbitraria Las mismas operaciones: wait y signal Proveen exclusión mutua

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. 22 Programming with POSIX* Threads Variable condición y Mutex Un mutex está asociado con una variable condición Protege la evaluación de la expresión condicional Previene condiciones de concurso entre los hilos que están enviando la señal y los hilos que esperan en la variable condició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. 23 Programming with POSIX* Threads Señales perdidas y falsas Una señal a una variable de condición no se guarda Si no hay un hilo esperando, la señal se pierde Un hilo puede interbloquearse esperando una señal que no será enviada Una variable de condición (rara vez) puede recibir señales falsas Si las señales se hacen predecibles la ejecución es más lenta Se requiere volver a probar la expresión de condició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. 24 Programming with POSIX* Threads Algoritmo de variables de condición Evita problemas con señales perdidas y señales falsas adquiere mutex; while (condición es verdadera) espera en la variable de condición; espera en la variable de condición; ejecuta región crítica; actualiza condición; envía señal a los hilos que esperan; libera mutex; Se niega la condición se necesita proceder El mutex se libera automáticamente cuando el hilo espera Puede ser opcional

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. 25 Programming with POSIX* Threads Variables Condición pthread_cond_init, pthread_cond_destroy Inicializa/destruye variables de condición pthread_cond_wait El hilo duerme hasta que se efectúa un signal a la variable de condición pthread_cond_signal Señal que libera la variable de condición pthread_cond_broadcast Broadcast que libera la variable de condició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. 26 Programming with POSIX* Threads Tipos de variables de condición Tipos de datos usados pthread_cond_t La variable de condición pthread_condattr_t Atributos de la variable de condición Antes de usar, la variable condición (y el mutex) deben inicializarse

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. 27 Programming with POSIX* Threads pthread_cond_init int pthread_cond_init( cond, attr ); pthread_cond_t *cond variable condición a ser inicializada const pthread_condattr_t *attr attributos a ser establecidos en la variable de conidición ENOMEM - insuficiente memoria para la variable condición EAGAIN - insuficientes recursos (diferentes a la memoria) EBUSY - variable de condición ya inicializada EINVAL - attr inválido

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. 28 Programming with POSIX* Threads Inicialización alternativa Puede usuarse un inicializador estático PTHREAD_COND_INITIALIZER Usa los atributos por default Los programadores deben estar atentos a la condición y alcance (del mutex) Debe ser visible a los hilos pthread_cond_t cond1 = PTHREAD_COND_INITIALIZER;

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. 29 Programming with POSIX* Threads pthread_cond_wait int pthread_cond_wait( cond, mutex ); pthread_cond_t *cond Variable condición a esperar pthread_mutex_t *mutex Debe desbloquearse

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. 30 Programming with POSIX* Threads pthread_cond_wait Detalles El hilo se bloquea esperando una señal en cond El mutex se desbloquea Permite que otros hilos adquiran el lock Cuando llega una señal, el mutex será readquirido antes de salir del pthread_cond_wait EINVAL - cond o mutex inválido EINVAL - mutex diferentes para esperaas concurrentes EINVAL - el hilo llamante no es dueño del mutex

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. 31 Programming with POSIX* Threads pthread_cond_signal int pthread_cond_signal( cond ); pthread_cond_t *cond Variable condición a la que se le enviará la señal

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. 32 Programming with POSIX* Threads pthread_cond_signal Detalles Envía una señal a una variable condición, desbloquea un hilo bloqueado Si no hay hilos esperando, no se toma ninguna acción La señal no se guarda para futuros hilos El hilo que envía la señal no requiere tener el mutex Puede ser más eficiente Puede haber problemas si se usan prioridades de hilos EINVAL - cond es inválida

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. 33 Programming with POSIX* Threads pthread_cond_broadcast int pthread_cond_broadcast( cond ); pthread_cond_t *cond variable condición a recibir la señal

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. 34 Programming with POSIX* Threads pthread_cond_broadcast detalles Desbloquea todos los hilos que están esperando una variable de condición Si no hay hilos esperando, no se toma ninguna acción Broadcast no se almacena para hilos futuros El hilo que envía la señal no necesita tener el mutex EINVAL - cond is inválida

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. 35 Programming with POSIX* Threads Programando con hilos POSIX* Temas cubiertos Como crear hilos que hagan trabajo encapsulado dentro de las funciones Coordinar acceso compartido entre hilos para evitar condiciones de concurso

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. 36 Programming with POSIX* Threads