Thread support library
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
C++ includes built-in support for threads, mutual exclusion, condition variables, and futures.
Sommaire |
[modifier] Threads
Threads enable programs to execute across several processor cores.
| Defined in header
<thread> | |
| (C++11) |
gère un thread séparé Original: manages a separate thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
Functions managing the current thread | |
| Defined in namespace
this_thread | |
| (C++11) |
suggests that the implementation reschedule execution of threads (fonction) |
| (C++11) |
retourne l'id du thread courant Original: returns the thread id of the current thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
| (C++11) |
arrête l'exécution du thread courant pendant une durée de temps spécifiée Original: stops the execution of the current thread for a specified time duration The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
| (C++11) |
arrête l'exécution du thread en cours jusqu'à un point dans le temps spécifié Original: stops the execution of the current thread until a specified time point The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
[modifier] L'exclusion mutuelle
Mutual exclusion algorithms prevent multiple threads from simultaneously accessing shared resources. This prevents data races and provides support for synchronization between threads.
| Defined in header
<mutex> | |
| (C++11) |
offre de base usine d'exclusion mutuelle Original: provides basic mutual exclusion facility The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
| (C++11) |
fournit le service d'exclusion mutuelle qui implémente verrouillage avec un délai d'attente Original: provides mutual exclusion facility which implements locking with a timeout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
| (C++11) |
fournit le service d'exclusion mutuelle qui peut être verrouillé de manière récursive par le même thread Original: provides mutual exclusion facility which can be locked recursively by the same thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
| (C++11) |
fournit le service d'exclusion mutuelle qui peut être verrouillé recursively par le même fil et des outils de verrouillage avec un délai d'attente Original: provides mutual exclusion facility which can be locked recursively by the same thread and implements locking with a timeout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
Generic mutex management | |
| (C++11) |
met en œuvre un wrapper mutex strictement la portée de l'appropriation Original: implements a strictly scope-based mutex ownership wrapper The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe générique) |
| (C++11) |
met en œuvre emballage mobile propriété mutex Original: implements movable mutex ownership wrapper The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe générique) |
| type de variable permet de spécifier la stratégie de verrouillage Original: tag type used to specify locking strategy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
| constantes tag utilisé pour spécifier la stratégie de verrouillage Original: tag constants used to specify locking strategy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante) | |
Generic locking algorithms | |
| (C++11) |
tente d'obtenir la propriété des mutex via des appels répétés à try_lock Original: attempts to obtain ownership of mutexes via repeated calls to try_lock The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
| (C++11) |
verrouille les mutex, les blocs spécifiés le cas échéant ne sont pas disponibles Original: locks specified mutexes, blocks if any are unavailable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
Original: Call once The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) |
objet d'aide pour s'assurer que call_once invoque la fonction qu'une seule fois Original: helper object to ensure that call_once invokes the function only once The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
| (C++11) |
appelle une fonction qu'une seule fois, même si elle est appelée par plusieurs threads Original: invokes a function only once even if called from multiple threads The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
[modifier] Les variables de condition
A condition variable is a synchronization primitive that allows multiple threads to communicate with eachother. It allows some number of threads to wait (possibly with a timeout) for notification from another thread that they may proceed. A condition variable is always associated with a mutex.
| Defined in header
<condition_variable> | |
| (C++11) |
provides a condition variable associated with a std::unique_lock (classe) |
| (C++11) |
provides a condition variable associated with any lock type (classe) |
| (C++11) |
schedules a call to notify_all to be invoked when this thread is completely finished (fonction) |
| (C++11) |
lists the possible results of timed waits on condition variables (enum) |
[modifier] Futures
The standard library provides facilities to obtain values that are returned and to catch exceptions that are thrown by asynchronous tasks (i.e. functions launched in separate threads). These values are communicated in a shared state, in which the asynchronous task may write its return value or store an exception, and which may be examined, waited for, and otherwise manipulated by other threads that hold instances of std::future or std::shared_future that reference that shared state.
| Defined in header
<future> | |
| (C++11) |
stocke une valeur pour une récupération asynchrone Original: stores a value for asynchronous retrieval The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe générique) |
| (C++11) |
paquets d'une fonction pour stocker sa valeur de retour pour la récupération asynchrone Original: packages a function to store its return value for asynchronous retrieval The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe générique) |
| (C++11) |
attend une valeur qui est définie de manière asynchrone Original: waits for a value that is set asynchronously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe générique) |
| (C++11) |
attend une valeur (peut-être référencé par d'autres futurs) qui est fixé de manière asynchrone Original: waits for a value (possibly referenced by other futures) that is set asynchronously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe générique) |
| (C++11) |
exécute une fonction asynchrone (potentiellement dans un nouveau thread) et renvoie une std::future qui contiendra le résultat Original: runs a function asynchronously (potentially in a new thread) and returns a std::future that will hold the result The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |
| (C++11) |
spécifie la politique de lancement de std::async Original: specifies the launch policy for std::async The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (enum) |
| (C++11) |
précise les résultats de chronométrés temps d'attente effectuée sur std::future et std::shared_future Original: specifies the results of timed waits performed on std::future and std::shared_future The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (enum) |
Future errors | |
| (C++11) |
signale une erreur liée aux contrats à terme ou des promesses Original: reports an error related to futures or promises The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
| (C++11) |
identifie la catégorie d'erreur avenir Original: identifies the future error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
| (C++11) |
identifie les codes d'erreur futures Original: identifies the future error codes The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (enum) |