◐ Shell
clean mode source ↗

std::launch — cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Déclaré dans l'en-tête

<future>

enum class launch : /* unspecified */ { async = /* unspecified */, deferred = /* unspecified */, /* implementation-defined */ };

(depuis C++11)

Spécifie la stratégie de lancement d'une tâche exécutée par la fonction std::async. std::launch est un BitmaskType (énumération, entier ou bitset) .

Original:

Specifies the launch policy for a task executed by the std::async function. std::launch is a BitmaskType (enumeration, integer, or bitset).

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Les constantes suivantes indiquant bits individuels sont définis par la bibliothèque standard:

Original:

The following constants denoting individual bits are defined by the standard library:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Constante

Original:

Constant

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Explanation
std::launch::async

un nouveau thread est lancé pour exécuter la tâche de façon asynchrone

Original:

a new thread is launched to execute the task asynchronously

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

std::launch::deferred

la tâche est exécutée sur le thread appelant la première fois son résultat est demandée (évaluation paresseuse)

Original:

the task is executed on the calling thread the first time its result is requested (lazy evaluation)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

En outre, les implémentations sont autorisés à:

Original:

In addition, implementations are allowed to:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

  • définir des bits supplémentaires et pour spécifier bitmasks restrictions sur les interactions de travail applicables à un sous-ensemble de politiques de lancement, et

    Original:

    define additional bits and bitmasks to specify restrictions on task interactions applicable to a subset of launch policies, and

    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

  • permettre à ces masques de bits supplémentaires pour le premier (par défaut) de surcharge std::async .

    Original:

    enable those additional bitmasks for the first (default) overload of std::async.

    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

Voir aussi

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) [edit]