Threads POSIX

Les threads POSIX, souvent appelés pthreads, sont un sous-standard de la norme POSIX décrivant une interface de programmation permettant de gérer des threads. Il s'agit du standard IEEE Std 1003.1c-1995 (POSIX.1c, Threads extensions).

Cette interface est disponible sur la plupart des systèmes Unix modernes, par exemple Linux, les différentes variantes modernes de BSD, Mac OS X et Solaris[1],[2]. Elle n'est pas disponible nativement sous Microsoft Windows mais il existe plusieurs implémentations dont une de Microsoft[3].

Spécification

Le standard définit un ensemble de types de données, de fonctions et de constantes en langage C. Le fichier à inclure dans les sources en C se nomme pthread.h. Une centaine de fonctions sont ainsi définies[4].

La bibliothèque dispose notamment de fonctions permettant la création et la destruction de threads, l'ordonnancement des tâches, leur synchronisation, la gestion des signaux et des données partagées[5].

Notes et références

  1. Daniel Robbins, « POSIX threads explained », IBM developerWorks : « When you want to write portable multithreaded code, code that works under Solaris, FreeBSD, Linux, and more, POSIX threads are the way to go. »
  2. José R.C. Cruz, « Mastering Threads on Mac OS X » : « The POSIX thread library (…) is platform-agnostic, and available on all POSIX-compliant systems such as Linux, BSD, and Mac OS X. »
  3. (en)« Pthread Support in Microsoft Windows Services for UNIX Version 3.5 », Microsoft,
  4. (en)« <pthread.h> », The Open Group
  5. (en) Adrien Lamothe « An overview of Pthreads with current trends » (lire en ligne).
    OSCON (O'Reilly Open Source Convention) 2007.

Bibliographie

Liens externes

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.