1
0
Fork 0

threading: thread & thread-local (#703)

Merci @deronnax \o/
This commit is contained in:
Mathieu Dupuy 2019-05-11 19:24:01 +02:00 committed by Julien Palard
parent c8cf445500
commit 7316208a62
2 changed files with 209 additions and 10 deletions

2
dict
View File

@ -82,6 +82,8 @@ réexécuter
référençable référençable
référençables référençables
réimplémenter réimplémenter
réimplémente
réimplémentez
résolveurs résolveurs
ſ ſ
sérialisable sérialisable

View File

@ -6,17 +6,19 @@ msgstr ""
"Project-Id-Version: Python 3.6\n" "Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-21 09:48+0100\n" "POT-Creation-Date: 2018-12-21 09:48+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2019-04-12 00:15+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: FRENCH <traductions@lists.afpy.org>\n" "Language-Team: FRENCH <traductions@lists.afpy.org>\n"
"Language: fr\n" "Language: fr\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Last-Translator: Mathieu Dupuy <deronnax@gmail.com>\n"
"X-Generator: Poedit 2.2.1\n"
#: ../Doc/library/threading.rst:2 #: ../Doc/library/threading.rst:2
msgid ":mod:`threading` --- Thread-based parallelism" msgid ":mod:`threading` --- Thread-based parallelism"
msgstr "" msgstr ""
":mod:`threading` — Parallélisme basé sur les fils dexécution (*threads*)"
#: ../Doc/library/threading.rst:7 #: ../Doc/library/threading.rst:7
msgid "**Source code:** :source:`Lib/threading.py`" msgid "**Source code:** :source:`Lib/threading.py`"
@ -27,10 +29,14 @@ msgid ""
"This module constructs higher-level threading interfaces on top of the lower " "This module constructs higher-level threading interfaces on top of the lower "
"level :mod:`_thread` module. See also the :mod:`queue` module." "level :mod:`_thread` module. See also the :mod:`queue` module."
msgstr "" msgstr ""
"Ce module élabore des interfaces haut-niveau de fils d'exécutions multiples "
"(*threading*) conçues en s'appuyant sur le module bas-niveau :mod:`_thread`. "
"Voir aussi le module :mod:`queue`."
#: ../Doc/library/threading.rst:14 #: ../Doc/library/threading.rst:14
msgid "This module used to be optional, it is now always available." msgid "This module used to be optional, it is now always available."
msgstr "" msgstr ""
"Ce module était auparavant optionnel, il est maintenant toujours disponible."
#: ../Doc/library/threading.rst:19 #: ../Doc/library/threading.rst:19
msgid "" msgid ""
@ -38,16 +44,21 @@ msgid ""
"methods and functions in this module in the Python 2.x series are still " "methods and functions in this module in the Python 2.x series are still "
"supported by this module." "supported by this module."
msgstr "" msgstr ""
"Bien qu'ils ne soient pas listés ci-dessous, ce module gère toujours les "
"noms en ``camelCase`` utilisés pour certaines méthodes et fonctions de ce "
"module dans la série Python 2.x."
#: ../Doc/library/threading.rst:24 #: ../Doc/library/threading.rst:24
msgid "This module defines the following functions:" msgid "This module defines the following functions:"
msgstr "" msgstr "Ce module définit les fonctions suivantes :"
#: ../Doc/library/threading.rst:29 #: ../Doc/library/threading.rst:29
msgid "" msgid ""
"Return the number of :class:`Thread` objects currently alive. The returned " "Return the number of :class:`Thread` objects currently alive. The returned "
"count is equal to the length of the list returned by :func:`.enumerate`." "count is equal to the length of the list returned by :func:`.enumerate`."
msgstr "" msgstr ""
"Renvoie le nombre d'objets :class:`Thread` actuellement vivants. Le compte "
"renvoyé est égal à la longueur de la liste renvoyée par :func:`.enumerate`."
#: ../Doc/library/threading.rst:35 #: ../Doc/library/threading.rst:35
msgid "" msgid ""
@ -56,6 +67,10 @@ msgid ""
"through the :mod:`threading` module, a dummy thread object with limited " "through the :mod:`threading` module, a dummy thread object with limited "
"functionality is returned." "functionality is returned."
msgstr "" msgstr ""
"Renvoie l'objet :class:`Thread` courant, correspondant au fil de contrôle de "
"l'appelant. Si le fil de contrôle de l'appelant n'a pas été créé via le "
"module :mod:`Thread`, un objet *thread* factice aux fonctionnalités limitées "
"est renvoyé."
#: ../Doc/library/threading.rst:43 #: ../Doc/library/threading.rst:43
msgid "" msgid ""
@ -65,6 +80,11 @@ msgid ""
"identifiers may be recycled when a thread exits and another thread is " "identifiers may be recycled when a thread exits and another thread is "
"created." "created."
msgstr "" msgstr ""
"Renvoie l'\"identificateur de fil\" du fil d'exécution courant. C'est un "
"entier non nul. Sa valeur n'a pas de signification directe ; il est destiné "
"à être utilisé comme valeur magique opaque, par exemple comme clef de "
"dictionnaire de données pour chaque fil. Les identificateurs de fils peuvent "
"être recyclés lorsqu'un fil se termine et qu'un autre fil est créé."
#: ../Doc/library/threading.rst:54 #: ../Doc/library/threading.rst:54
msgid "" msgid ""
@ -73,12 +93,19 @@ msgid ""
"`current_thread`, and the main thread. It excludes terminated threads and " "`current_thread`, and the main thread. It excludes terminated threads and "
"threads that have not yet been started." "threads that have not yet been started."
msgstr "" msgstr ""
"Renvoie une liste de tous les objets fil d'exécution :class:`Thread` "
"actuellement vivants. La liste inclut les fils démons, les fils factices "
"créés par :func:`current_thread` et le fil principal. Elle exclut les fils "
"terminés et les fils qui n'ont pas encore été lancés."
#: ../Doc/library/threading.rst:62 #: ../Doc/library/threading.rst:62
msgid "" msgid ""
"Return the main :class:`Thread` object. In normal conditions, the main " "Return the main :class:`Thread` object. In normal conditions, the main "
"thread is the thread from which the Python interpreter was started." "thread is the thread from which the Python interpreter was started."
msgstr "" msgstr ""
"Renvoie l'objet fil d'exécution :class:`Thread` principal. Dans des "
"conditions normales, le fil principal est le fil à partir duquel "
"l'interpréteur Python a été lancé."
#: ../Doc/library/threading.rst:73 #: ../Doc/library/threading.rst:73
msgid "" msgid ""
@ -86,6 +113,10 @@ msgid ""
"module. The *func* will be passed to :func:`sys.settrace` for each thread, " "module. The *func* will be passed to :func:`sys.settrace` for each thread, "
"before its :meth:`~Thread.run` method is called." "before its :meth:`~Thread.run` method is called."
msgstr "" msgstr ""
"Attache une fonction de traçage pour tous les fils d'exécution démarrés "
"depuis le module :mod:`Thread`. La fonction *func* est passée à :func:`sys."
"settrace` pour chaque fil, avant que sa méthode :meth:`~Thread.run` soit "
"appelée."
#: ../Doc/library/threading.rst:82 #: ../Doc/library/threading.rst:82
msgid "" msgid ""
@ -93,6 +124,10 @@ msgid ""
"module. The *func* will be passed to :func:`sys.setprofile` for each " "module. The *func* will be passed to :func:`sys.setprofile` for each "
"thread, before its :meth:`~Thread.run` method is called." "thread, before its :meth:`~Thread.run` method is called."
msgstr "" msgstr ""
"Attache une fonction de profilage pour tous les fils d'exécution démarrés "
"depuis le module :mod:`Threading`. La fonction *func* est passée à :func:"
"`sys.setprofile` pour chaque fil, avant que sa méthode :meth:`~Thread.run` "
"soit appelée."
#: ../Doc/library/threading.rst:89 #: ../Doc/library/threading.rst:89
msgid "" msgid ""
@ -112,6 +147,24 @@ msgid ""
"stack size is the suggested approach in the absence of more specific " "stack size is the suggested approach in the absence of more specific "
"information)." "information)."
msgstr "" msgstr ""
"Renvoie la taille de la pile d'exécution utilisée lors de la création de "
"nouveaux fils d'exécution. L'argument optionnel *size* spécifie la taille de "
"pile à utiliser pour les fils créés ultérieurement, et doit être 0 (pour "
"utiliser la taille de la plate-forme ou la valeur configurée par défaut) ou "
"un entier positif supérieur ou égal à 32 768 (32 Kio). Si *size* n'est pas "
"spécifié, 0 est utilisé. Si la modification de la taille de la pile de fils "
"n'est pas prise en charge, une :exc:`RuntimeError` est levée. Si la taille "
"de pile spécifiée n'est pas valide, une :exc:`ValueError` est levée et la "
"taille de pile n'est pas modifiée. 32 Kio est actuellement la valeur "
"minimale de taille de pile prise en charge pour garantir un espace de pile "
"suffisant pour l'interpréteur lui-même. Notez que certaines plates-formes "
"peuvent avoir des restrictions particulières sur les valeurs de taille de la "
"pile, telles que l'exigence d'une taille de pile minimale > 32 Kio ou d'une "
"allocation en multiples de la taille de page de la mémoire du système la "
"documentation de la plate-forme devrait être consultée pour plus "
"d'informations (4 Kio sont courantes ; en l'absence de renseignements plus "
"spécifiques, l'approche proposée est l'utilisation de multiples de 4 096 "
"pour la taille de la pile)."
#: ../Doc/library/threading.rst:104 #: ../Doc/library/threading.rst:104
msgid "" msgid ""
@ -122,7 +175,7 @@ msgstr ""
#: ../Doc/library/threading.rst:107 #: ../Doc/library/threading.rst:107
msgid "This module also defines the following constant:" msgid "This module also defines the following constant:"
msgstr "" msgstr "Ce module définit également la constante suivante :"
#: ../Doc/library/threading.rst:111 #: ../Doc/library/threading.rst:111
msgid "" msgid ""
@ -131,12 +184,18 @@ msgid ""
"Specifying a timeout greater than this value will raise an :exc:" "Specifying a timeout greater than this value will raise an :exc:"
"`OverflowError`." "`OverflowError`."
msgstr "" msgstr ""
"La valeur maximale autorisée pour le paramètre *timeout* des fonctions "
"bloquantes (:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition."
"wait`, etc.). Spécifier un délai d'attente supérieur à cette valeur lève "
"une :exc:`OverflowError`."
#: ../Doc/library/threading.rst:119 #: ../Doc/library/threading.rst:119
msgid "" msgid ""
"This module defines a number of classes, which are detailed in the sections " "This module defines a number of classes, which are detailed in the sections "
"below." "below."
msgstr "" msgstr ""
"Ce module définit un certain nombre de classes, qui sont détaillées dans les "
"sections ci-dessous."
#: ../Doc/library/threading.rst:122 #: ../Doc/library/threading.rst:122
msgid "" msgid ""
@ -148,14 +207,24 @@ msgid ""
"stopped, suspended, resumed, or interrupted. The static methods of Java's " "stopped, suspended, resumed, or interrupted. The static methods of Java's "
"Thread class, when implemented, are mapped to module-level functions." "Thread class, when implemented, are mapped to module-level functions."
msgstr "" msgstr ""
"La conception de ce module est librement basée sur le modèle des fils "
"d'exécution de Java. Cependant, là où Java fait des verrous et des variables "
"de condition le comportement de base de chaque objet, ils sont des objets "
"séparés en Python. La classe Python :class:`Thread` prend en charge un sous-"
"ensemble du comportement de la classe *Thread* de Java ; actuellement, il "
"n'y a aucune priorité, aucun groupe de fils d'exécution, et les fils ne "
"peuvent être détruits, arrêtés, suspendus, repris ni interrompus. Les "
"méthodes statiques de la classe *Thread* de Java, lorsqu'elles sont "
"implémentées, correspondent à des fonctions au niveau du module."
#: ../Doc/library/threading.rst:130 #: ../Doc/library/threading.rst:130
msgid "All of the methods described below are executed atomically." msgid "All of the methods described below are executed atomically."
msgstr "" msgstr ""
"Toutes les méthodes décrites ci-dessous sont exécutées de manière atomique."
#: ../Doc/library/threading.rst:134 #: ../Doc/library/threading.rst:134
msgid "Thread-Local Data" msgid "Thread-Local Data"
msgstr "" msgstr "Données locales au fil d'exécution"
#: ../Doc/library/threading.rst:136 #: ../Doc/library/threading.rst:136
msgid "" msgid ""
@ -163,24 +232,31 @@ msgid ""
"thread-local data, just create an instance of :class:`local` (or a subclass) " "thread-local data, just create an instance of :class:`local` (or a subclass) "
"and store attributes on it::" "and store attributes on it::"
msgstr "" msgstr ""
"Les données locales au fil d'exécution (*thread-local data*) sont des "
"données dont les valeurs sont propres à chaque fil. Pour gérer les données "
"locales au fil, il suffit de créer une instance de :class:`local` (ou une "
"sous-classe) et d'y stocker des données : ::"
#: ../Doc/library/threading.rst:143 #: ../Doc/library/threading.rst:143
msgid "The instance's values will be different for separate threads." msgid "The instance's values will be different for separate threads."
msgstr "" msgstr ""
"Les valeurs dans l'instance sont différentes pour des *threads* différents."
#: ../Doc/library/threading.rst:148 #: ../Doc/library/threading.rst:148
msgid "A class that represents thread-local data." msgid "A class that represents thread-local data."
msgstr "" msgstr "Classe qui représente les données locales au fil d'exécution."
#: ../Doc/library/threading.rst:150 #: ../Doc/library/threading.rst:150
msgid "" msgid ""
"For more details and extensive examples, see the documentation string of " "For more details and extensive examples, see the documentation string of "
"the :mod:`_threading_local` module." "the :mod:`_threading_local` module."
msgstr "" msgstr ""
"Pour plus de détails et de nombreux exemples, voir la chaîne de "
"documentation du module :mod:`_threading_local`."
#: ../Doc/library/threading.rst:157 #: ../Doc/library/threading.rst:157
msgid "Thread Objects" msgid "Thread Objects"
msgstr "" msgstr "Objets *Threads*"
#: ../Doc/library/threading.rst:159 #: ../Doc/library/threading.rst:159
msgid "" msgid ""
@ -191,6 +267,13 @@ msgid ""
"be overridden in a subclass. In other words, *only* override the :meth:" "be overridden in a subclass. In other words, *only* override the :meth:"
"`~Thread.__init__` and :meth:`~Thread.run` methods of this class." "`~Thread.__init__` and :meth:`~Thread.run` methods of this class."
msgstr "" msgstr ""
"La classe fil d'exécution :class:`Thread` représente une activité qui est "
"exécutée dans un fil d'exécution séparé. Il y a deux façons de spécifier "
"l'activité : en passant un objet appelable au constructeur, ou en ré-"
"implémentant la méthode :meth:`~Thread.run` dans une sous-classe. Aucune "
"autre méthode (à l'exception du constructeur) ne doit être remplacée dans "
"une sous-classe. En d'autres termes, réimplémentez *seulement* les méthodes :"
"meth:`~Thread.__init__` et :meth:`~Thread.run` de cette classe."
#: ../Doc/library/threading.rst:166 #: ../Doc/library/threading.rst:166
msgid "" msgid ""
@ -198,6 +281,9 @@ msgid ""
"thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` "
"method in a separate thread of control." "method in a separate thread of control."
msgstr "" msgstr ""
"Une fois qu'un objet fil d'exécution est créé, son activité doit être lancée "
"en appelant la méthode :meth:`~Thread.start` du fil. Ceci invoque la "
"méthode :meth:`~Thread.run` dans un fil d'exécution séparé."
#: ../Doc/library/threading.rst:170 #: ../Doc/library/threading.rst:170
msgid "" msgid ""
@ -206,6 +292,10 @@ msgid ""
"normally, or by raising an unhandled exception. The :meth:`~Thread." "normally, or by raising an unhandled exception. The :meth:`~Thread."
"is_alive` method tests whether the thread is alive." "is_alive` method tests whether the thread is alive."
msgstr "" msgstr ""
"Une fois que l'activité du fil d'exécution est lancée, le fil est considéré "
"comme « vivant ». Il cesse d'être vivant lorsque sa méthode :meth:`~Thread."
"run` se termine soit normalement, soit en levant une exception non gérée. "
"La méthode :meth:`~Thread.is_alive` teste si le fil est vivant."
#: ../Doc/library/threading.rst:175 #: ../Doc/library/threading.rst:175
msgid "" msgid ""
@ -213,12 +303,17 @@ msgid ""
"the calling thread until the thread whose :meth:`~Thread.join` method is " "the calling thread until the thread whose :meth:`~Thread.join` method is "
"called is terminated." "called is terminated."
msgstr "" msgstr ""
"D'autres fils d'exécution peuvent appeler la méthode :meth:`~Thread.join` "
"d'un fil. Ceci bloque le fil appelant jusqu'à ce que le fil dont la méthode :"
"meth:`~Thread.join` est appelée soit terminé."
#: ../Doc/library/threading.rst:179 #: ../Doc/library/threading.rst:179
msgid "" msgid ""
"A thread has a name. The name can be passed to the constructor, and read or " "A thread has a name. The name can be passed to the constructor, and read or "
"changed through the :attr:`~Thread.name` attribute." "changed through the :attr:`~Thread.name` attribute."
msgstr "" msgstr ""
"Un fil d'exécution a un nom. Le nom peut être passé au constructeur, et lu "
"ou modifié via l'attribut :attr:`~Thread.name`."
#: ../Doc/library/threading.rst:182 #: ../Doc/library/threading.rst:182
msgid "" msgid ""
@ -228,6 +323,11 @@ msgid ""
"can be set through the :attr:`~Thread.daemon` property or the *daemon* " "can be set through the :attr:`~Thread.daemon` property or the *daemon* "
"constructor argument." "constructor argument."
msgstr "" msgstr ""
"Un fil d'exécution peut être marqué comme « fil démon ». Un programme Python "
"se termine quand il ne reste plus que des fils démons. La valeur initiale "
"est héritée du fil d'exécution qui l'a créé. Cette option peut être définie "
"par la propriété :attr:`~Thread.daemon` ou par l'argument *daemon* du "
"constructeur."
#: ../Doc/library/threading.rst:189 #: ../Doc/library/threading.rst:189
msgid "" msgid ""
@ -236,12 +336,20 @@ msgid ""
"you want your threads to stop gracefully, make them non-daemonic and use a " "you want your threads to stop gracefully, make them non-daemonic and use a "
"suitable signalling mechanism such as an :class:`Event`." "suitable signalling mechanism such as an :class:`Event`."
msgstr "" msgstr ""
"Les fils d'exécution démons sont brusquement terminés à l'arrêt du programme "
"Python. Leurs ressources (fichiers ouverts, transactions de base de données, "
"etc.) peuvent ne pas être libérées correctement. Si vous voulez que vos fils "
"s'arrêtent proprement, faites en sorte qu'ils ne soient pas démoniques et "
"utilisez un mécanisme de signalisation approprié tel qu'un objet évènement :"
"class:`Event`."
#: ../Doc/library/threading.rst:194 #: ../Doc/library/threading.rst:194
msgid "" msgid ""
"There is a \"main thread\" object; this corresponds to the initial thread of " "There is a \"main thread\" object; this corresponds to the initial thread of "
"control in the Python program. It is not a daemon thread." "control in the Python program. It is not a daemon thread."
msgstr "" msgstr ""
"Il y a un objet \"fil principal\", qui correspond au fil de contrôle initial "
"dans le programme Python. Ce n'est pas un fil démon."
#: ../Doc/library/threading.rst:197 #: ../Doc/library/threading.rst:197
msgid "" msgid ""
@ -252,41 +360,62 @@ msgid ""
"alive and daemonic, and cannot be :meth:`~Thread.join`\\ ed. They are never " "alive and daemonic, and cannot be :meth:`~Thread.join`\\ ed. They are never "
"deleted, since it is impossible to detect the termination of alien threads." "deleted, since it is impossible to detect the termination of alien threads."
msgstr "" msgstr ""
"Il y a une possibilité que des objets fil d'exécution « fictifs » soient "
"créés. Ce sont des objets correspondant à des fils d'exécution "
 étrangers », qui sont des fils de contrôle démarrés en dehors du module de "
"*threading*, par exemple directement depuis du code C. Les objets fils "
"d'exécution fictifs ont des fonctionnalités limitées ; ils sont toujours "
"considérés comme vivants et démoniques, et ne peuvent pas être attendus via :"
"meth:`~Thread.join`. Ils ne sont jamais supprimés, car il est impossible de "
"détecter la fin des fils d'exécution étrangers."
#: ../Doc/library/threading.rst:208 #: ../Doc/library/threading.rst:208
msgid "" msgid ""
"This constructor should always be called with keyword arguments. Arguments " "This constructor should always be called with keyword arguments. Arguments "
"are:" "are:"
msgstr "" msgstr ""
"Ce constructeur doit toujours être appelé avec des arguments nommés. Les "
"arguments sont :"
#: ../Doc/library/threading.rst:211 #: ../Doc/library/threading.rst:211
msgid "" msgid ""
"*group* should be ``None``; reserved for future extension when a :class:" "*group* should be ``None``; reserved for future extension when a :class:"
"`ThreadGroup` class is implemented." "`ThreadGroup` class is implemented."
msgstr "" msgstr ""
"*group* doit être ``None`` ; cet argument est réservé pour une extension "
"future lorsqu'une classe :class:`ThreadGroup` sera implémentée."
#: ../Doc/library/threading.rst:214 #: ../Doc/library/threading.rst:214
msgid "" msgid ""
"*target* is the callable object to be invoked by the :meth:`run` method. " "*target* is the callable object to be invoked by the :meth:`run` method. "
"Defaults to ``None``, meaning nothing is called." "Defaults to ``None``, meaning nothing is called."
msgstr "" msgstr ""
"*target* est l'objet appelable qui doit être invoqué par la méthode :meth:"
"`run`. La valeur par défaut est ``None``, ce qui signifie que rien n'est "
"appelé."
#: ../Doc/library/threading.rst:217 #: ../Doc/library/threading.rst:217
msgid "" msgid ""
"*name* is the thread name. By default, a unique name is constructed of the " "*name* is the thread name. By default, a unique name is constructed of the "
"form \"Thread-*N*\" where *N* is a small decimal number." "form \"Thread-*N*\" where *N* is a small decimal number."
msgstr "" msgstr ""
"*name* est le nom du fil d'exécution. Par défaut, un nom unique est "
"construit de la forme « Thread*N* » où *N* est un petit nombre décimal."
#: ../Doc/library/threading.rst:220 #: ../Doc/library/threading.rst:220
msgid "" msgid ""
"*args* is the argument tuple for the target invocation. Defaults to ``()``." "*args* is the argument tuple for the target invocation. Defaults to ``()``."
msgstr "" msgstr ""
"*args* est le tuple d'arguments pour l'invocation de l'objet appelable. La "
"valeur par défaut est ``()``."
#: ../Doc/library/threading.rst:222 #: ../Doc/library/threading.rst:222
msgid "" msgid ""
"*kwargs* is a dictionary of keyword arguments for the target invocation. " "*kwargs* is a dictionary of keyword arguments for the target invocation. "
"Defaults to ``{}``." "Defaults to ``{}``."
msgstr "" msgstr ""
"*kwargs* est un dictionnaire d'arguments nommés pour l'invocation de l'objet "
"appelable. La valeur par défaut est ``{}``."
#: ../Doc/library/threading.rst:225 #: ../Doc/library/threading.rst:225
msgid "" msgid ""
@ -294,6 +423,9 @@ msgid ""
"``None`` (the default), the daemonic property is inherited from the current " "``None`` (the default), the daemonic property is inherited from the current "
"thread." "thread."
msgstr "" msgstr ""
"S'il ne vaut pas ``None``, *daemon* définit explicitement si le fil "
"d'exécution est démonique ou pas. S'il vaut ``None`` (par défaut), la valeur "
"est héritée du fil courant."
#: ../Doc/library/threading.rst:229 #: ../Doc/library/threading.rst:229
msgid "" msgid ""
@ -301,6 +433,9 @@ msgid ""
"base class constructor (``Thread.__init__()``) before doing anything else to " "base class constructor (``Thread.__init__()``) before doing anything else to "
"the thread." "the thread."
msgstr "" msgstr ""
"Si la sous-classe réimplémente le constructeur, elle doit s'assurer "
"d'appeler le constructeur de la classe de base (``Thread.__init__()``) avant "
"de faire autre chose au fil d'exécution."
#: ../Doc/library/threading.rst:233 #: ../Doc/library/threading.rst:233
msgid "Added the *daemon* argument." msgid "Added the *daemon* argument."
@ -308,7 +443,7 @@ msgstr "Ajout de l'argument *daemon*."
#: ../Doc/library/threading.rst:238 #: ../Doc/library/threading.rst:238
msgid "Start the thread's activity." msgid "Start the thread's activity."
msgstr "" msgstr "Lance l'activité du fil d'exécution."
#: ../Doc/library/threading.rst:240 #: ../Doc/library/threading.rst:240
msgid "" msgid ""
@ -316,16 +451,21 @@ msgid ""
"object's :meth:`~Thread.run` method to be invoked in a separate thread of " "object's :meth:`~Thread.run` method to be invoked in a separate thread of "
"control." "control."
msgstr "" msgstr ""
"Elle ne doit être appelée qu'une fois par objet de fil. Elle fait en sorte "
"que la méthode :meth:`~Thread.run` de l'objet soit invoquée dans un fil "
"d'exécution."
#: ../Doc/library/threading.rst:244 #: ../Doc/library/threading.rst:244
msgid "" msgid ""
"This method will raise a :exc:`RuntimeError` if called more than once on the " "This method will raise a :exc:`RuntimeError` if called more than once on the "
"same thread object." "same thread object."
msgstr "" msgstr ""
"Cette méthode lève une :exc:`RuntimeError` si elle est appelée plus d'une "
"fois sur le même objet fil d'exécution."
#: ../Doc/library/threading.rst:249 #: ../Doc/library/threading.rst:249
msgid "Method representing the thread's activity." msgid "Method representing the thread's activity."
msgstr "" msgstr "Méthode représentant l'activité du fil d'exécution."
#: ../Doc/library/threading.rst:251 #: ../Doc/library/threading.rst:251
msgid "" msgid ""
@ -334,6 +474,11 @@ msgid ""
"*target* argument, if any, with sequential and keyword arguments taken from " "*target* argument, if any, with sequential and keyword arguments taken from "
"the *args* and *kwargs* arguments, respectively." "the *args* and *kwargs* arguments, respectively."
msgstr "" msgstr ""
"Vous pouvez remplacer cette méthode dans une sous-classe. La méthode "
"standard :meth:`run` invoque l'objet appelable passé au constructeur de "
"l'objet en tant qu'argument *target*, le cas échéant, avec des arguments "
"positionnels et des arguments nommés tirés respectivement des arguments "
"*args* et *kwargs*."
#: ../Doc/library/threading.rst:258 #: ../Doc/library/threading.rst:258
msgid "" msgid ""
@ -342,6 +487,10 @@ msgid ""
"normally or through an unhandled exception -- or until the optional timeout " "normally or through an unhandled exception -- or until the optional timeout "
"occurs." "occurs."
msgstr "" msgstr ""
"Attend que le fil d'exécution se termine. Ceci bloque le fil appelant "
"jusqu'à ce que le fil dont la méthode :meth:`~Thread.join` est appelée se "
"termine soit normalement, soit par une exception non gérée ou jusqu'à ce "
"que le délai optionnel *timeout* soit atteint."
#: ../Doc/library/threading.rst:263 #: ../Doc/library/threading.rst:263
msgid "" msgid ""
@ -352,16 +501,26 @@ msgid ""
"whether a timeout happened -- if the thread is still alive, the :meth:" "whether a timeout happened -- if the thread is still alive, the :meth:"
"`~Thread.join` call timed out." "`~Thread.join` call timed out."
msgstr "" msgstr ""
"Lorsque l'argument *timeout* est présent et ne vaut pas ``None``, il doit "
"être un nombre en virgule flottante spécifiant un délai pour l'opération en "
"secondes (ou fractions de secondes). Comme :meth:`~Thread.join` renvoie "
"toujours ``None``, vous devez appeler :meth:`~Thread.is_alive` après :meth:"
"`~Thread.join` pour déterminer si le délai a expiré si le fil d'exécution "
"est toujours vivant, c'est que l'appel à :meth:`~Thread.join` a expiré."
#: ../Doc/library/threading.rst:270 #: ../Doc/library/threading.rst:270
msgid "" msgid ""
"When the *timeout* argument is not present or ``None``, the operation will " "When the *timeout* argument is not present or ``None``, the operation will "
"block until the thread terminates." "block until the thread terminates."
msgstr "" msgstr ""
"Lorsque l'argument *timeout* n'est pas présent ou vaut ``None``, l'opération "
"se bloque jusqu'à ce que le fil d'exécution se termine."
#: ../Doc/library/threading.rst:273 #: ../Doc/library/threading.rst:273
msgid "A thread can be :meth:`~Thread.join`\\ ed many times." msgid "A thread can be :meth:`~Thread.join`\\ ed many times."
msgstr "" msgstr ""
"Un fil d'exécution peut être attendu via :meth:`~Thread.join` de nombreuses "
"fois."
#: ../Doc/library/threading.rst:275 #: ../Doc/library/threading.rst:275
msgid "" msgid ""
@ -370,6 +529,11 @@ msgid ""
"to :meth:`~Thread.join` a thread before it has been started and attempts to " "to :meth:`~Thread.join` a thread before it has been started and attempts to "
"do so raise the same exception." "do so raise the same exception."
msgstr "" msgstr ""
":meth:`~Thread.join` lève une :exc:`RuntimeError` si une tentative est faite "
"pour attendre le fil d'exécution courant car cela conduirait à un "
"interblocage (*deadlock* en anglais). Attendre via :meth:`~Thread.join` un "
"fil d'exécution avant son lancement est aussi une erreur et, si vous tentez "
"de le faire, lève la même exception."
#: ../Doc/library/threading.rst:282 #: ../Doc/library/threading.rst:282
msgid "" msgid ""
@ -377,12 +541,17 @@ msgid ""
"Multiple threads may be given the same name. The initial name is set by the " "Multiple threads may be given the same name. The initial name is set by the "
"constructor." "constructor."
msgstr "" msgstr ""
"Une chaîne de caractères utilisée à des fins d'identification seulement. "
"Elle n'a pas de sémantique. Plusieurs fils d'exécution peuvent porter le "
"même nom. Le nom initial est défini par le constructeur."
#: ../Doc/library/threading.rst:289 #: ../Doc/library/threading.rst:289
msgid "" msgid ""
"Old getter/setter API for :attr:`~Thread.name`; use it directly as a " "Old getter/setter API for :attr:`~Thread.name`; use it directly as a "
"property instead." "property instead."
msgstr "" msgstr ""
"Anciens accesseur et mutateur pour :attr:`~Thread.name` ; utilisez plutôt ce "
"dernier directement."
#: ../Doc/library/threading.rst:294 #: ../Doc/library/threading.rst:294
msgid "" msgid ""
@ -392,10 +561,15 @@ msgid ""
"another thread is created. The identifier is available even after the " "another thread is created. The identifier is available even after the "
"thread has exited." "thread has exited."
msgstr "" msgstr ""
 L'identificateur de fil d'exécution » de ce fil ou ``None`` si le fil n'a "
"pas été lancé. C'est un entier non nul. Voyez également la fonction :func:"
"`get_ident`. Les identificateurs de fils peuvent être recyclés lorsqu'un fil "
"se termine et qu'un autre fil est créé. L'identifiant est disponible même "
"après que le fil ait terminé."
#: ../Doc/library/threading.rst:302 #: ../Doc/library/threading.rst:302
msgid "Return whether the thread is alive." msgid "Return whether the thread is alive."
msgstr "" msgstr "Renvoie si le fil d'exécution est vivant ou pas."
#: ../Doc/library/threading.rst:304 #: ../Doc/library/threading.rst:304
msgid "" msgid ""
@ -403,6 +577,10 @@ msgid ""
"starts until just after the :meth:`~Thread.run` method terminates. The " "starts until just after the :meth:`~Thread.run` method terminates. The "
"module function :func:`.enumerate` returns a list of all alive threads." "module function :func:`.enumerate` returns a list of all alive threads."
msgstr "" msgstr ""
"Cette méthode renvoie ``True`` depuis juste avant le démarrage de la "
"méthode :meth:`~Thread.run` et jusqu'à juste après la terminaison de la "
"méthode :meth:`~Thread.run`. La fonction :func:`.enumerate` du module "
"renvoie une liste de tous les fils d'exécution vivants."
#: ../Doc/library/threading.rst:310 #: ../Doc/library/threading.rst:310
msgid "" msgid ""
@ -413,17 +591,27 @@ msgid ""
"therefore all threads created in the main thread default to :attr:`~Thread." "therefore all threads created in the main thread default to :attr:`~Thread."
"daemon` = ``False``." "daemon` = ``False``."
msgstr "" msgstr ""
"Booléen indiquant si ce fil d'exécution est un fil démon (``True``) ou non "
"(``False``). Celui-ci doit être défini avant que :meth:`~Thread.start` ne "
"soit appelé, sinon :exc:`RuntimeError` est levée. Sa valeur initiale est "
"héritée du fil d'exécution créateur ; le fil principal n'est pas un fil "
"démon et donc tous les fils créés dans ce fil principal ont par défaut la "
"valeur :attr:`~Thread.daemon` = ``False``."
#: ../Doc/library/threading.rst:317 #: ../Doc/library/threading.rst:317
msgid "" msgid ""
"The entire Python program exits when no alive non-daemon threads are left." "The entire Python program exits when no alive non-daemon threads are left."
msgstr "" msgstr ""
"Le programme Python se termine lorsqu'il ne reste plus de fils d'exécution "
"non-démons vivants."
#: ../Doc/library/threading.rst:322 #: ../Doc/library/threading.rst:322
msgid "" msgid ""
"Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a " "Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a "
"property instead." "property instead."
msgstr "" msgstr ""
"Anciens accesseur et mutateur pour :attr:`~Thread.daemon` ; utilisez plutôt "
"ce dernier directement."
#: ../Doc/library/threading.rst:328 #: ../Doc/library/threading.rst:328
msgid "" msgid ""
@ -435,6 +623,15 @@ msgid ""
"ProcessPoolExecutor`. However, threading is still an appropriate model if " "ProcessPoolExecutor`. However, threading is still an appropriate model if "
"you want to run multiple I/O-bound tasks simultaneously." "you want to run multiple I/O-bound tasks simultaneously."
msgstr "" msgstr ""
"En CPython, en raison du verrou global de l'interpréteur (:term:`Global "
"Interpreter Lock`), un seul fil d'exécution peut exécuter du code Python à "
"la fois (même si certaines bibliothèques orientées performance peuvent "
"surmonter cette limitation). Si vous voulez que votre application fasse un "
"meilleur usage des ressources de calcul des machines multi-cœurs, nous vous "
"conseillons d'utiliser :mod:`multiprocessing` ou :class:`concurrent.futures."
"ProcessPoolExecutor`. Néanmoins, les fils d'exécutions multiples restent un "
"modèle approprié si vous souhaitez exécuter simultanément plusieurs tâches "
"limitées par les performances des entrées-sorties."
#: ../Doc/library/threading.rst:341 #: ../Doc/library/threading.rst:341
msgid "Lock Objects" msgid "Lock Objects"