Debian Codegraph @

po/fr/man2/futex.2.po

raw
1 # French translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003.
5 # Stéphan Rafin <[email protected]>, 2002.
6 # Thierry Vignaud <[email protected]>, 1999, 2002.
7 # François Micaux, 2002.
8 # Alain Portal <[email protected]>, 2003-2008.
9 # Jean-Philippe Guérard <[email protected]>, 2005-2006.
10 # Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007.
11 # Julien Cristau <[email protected]>, 2006-2007.
12 # Thomas Huriaux <[email protected]>, 2006-2008.
13 # Nicolas François <[email protected]>, 2006-2008.
14 # Florentin Duneau <[email protected]>, 2006-2010.
15 # Simon Paillard <[email protected]>, 2006, 2013-2014.
16 # Denis Barbier <[email protected]>, 2006, 2010.
17 # David Prévot <[email protected]>, 2010-2014.
18 # Jean-Philippe MENGUAL <[email protected]>, 2020-2024.
19 msgid ""
20 msgstr ""
21 "Project-Id-Version: manpages-l10n 4.24.0\n"
22 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
23 "PO-Revision-Date: 2024-11-05 18:09+0100\n"
24 "Last-Translator: Jean-Philippe MENGUAL <[email protected]>\n"
25 "Language-Team: French <[email protected]>\n"
26 "Language: fr\n"
27 "MIME-Version: 1.0\n"
28 "Content-Type: text/plain; charset=UTF-8\n"
29 "Content-Transfer-Encoding: 8bit\n"
30 "Plural-Forms: nplurals=2; plural=n > 1;\n"
31 "X-Generator: Lokalize 22.12.3\n"
32
33 #. type: TH
34 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
35 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
36 #, no-wrap
37 msgid "futex"
38 msgstr "futex"
39
40 #. type: TH
41 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "2026-02-14"
44 msgstr "14 février 2026"
45
46 #. type: TH
47 #: archlinux debian-unstable
48 #, no-wrap
49 msgid "Linux man-pages 6.18"
50 msgstr "Pages du manuel de Linux 6.18"
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "NAME"
57 msgstr "NOM"
58
59 #. type: Plain text
60 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
61 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "futex - fast user-space locking"
63 msgstr "futex – Verrouillage rapide en mode utilisateur"
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "LIBRARY"
70 msgstr "BIBLIOTHÈQUE"
71
72 #. type: Plain text
73 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
74 #: opensuse-leap-16-1 opensuse-tumbleweed
75 msgid "Standard C library (I<libc>,\\ I<-lc>)"
76 msgstr "Bibliothèque C standard (I<libc>,\\ I<-lc>)"
77
78 #. type: SH
79 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
80 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
81 #, no-wrap
82 msgid "SYNOPSIS"
83 msgstr "SYNOPSIS"
84
85 #. type: Plain text
86 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
87 #: opensuse-tumbleweed
88 #, fuzzy, no-wrap
89 #| msgid ""
90 #| "B<#include E<lt>linux/futex.hE<gt>> /* Definition of B<FUTEX_*> constants */\n"
91 #| "B<#include E<lt>sys/syscall.hE<gt>> /* Definition of B<SYS_*> constants */\n"
92 #| "B<#include E<lt>unistd.hE<gt>>\n"
93 msgid ""
94 "B<#include E<lt>linux/futex.hE<gt>> /* Definition of B<FUTEX_*> constants */\n"
95 "B<#include E<lt>sys/syscall.hE<gt>> /* Definition of B<SYS_*> constants */\n"
96 "B<#include E<lt>unistd.hE<gt>>\n"
97 msgstr ""
98 "B<#include E<lt>linux/futex.hE<gt>> /* Définition des constantes B<FUTEX_*> */\n"
99 "B<#include E<lt>sys/syscall.hE<gt>> /* Définition des constantes B<SYS_*> */\n"
100 "B<#include E<lt>unistd.hE<gt>>\n"
101
102 #. type: Plain text
103 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
104 #: opensuse-tumbleweed
105 #, fuzzy, no-wrap
106 #| msgid "B<int ioctl(int >I<fd>B<, int >I<op>B<, ...);>\n"
107 msgid "B<long syscall(SYS_futex, uint32_t *>I<uaddr>B<, int >I<op>B<, ...);>\n"
108 msgstr "B<int ioctl(int >I<fd>B<, int >I<op>B<, ...);>\n"
109
110 #. type: SH
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 #, no-wrap
114 msgid "DESCRIPTION"
115 msgstr "DESCRIPTION"
116
117 #. type: Plain text
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 msgid ""
121 "The B<futex>() system call provides a method for waiting until a certain "
122 "condition becomes true. It is typically used as a blocking construct in the "
123 "context of shared-memory synchronization. When using futexes, the majority "
124 "of the synchronization operations are performed in user space. A user-space "
125 "program employs the B<futex>() system call only when it is likely that the "
126 "program has to block for a longer time until the condition becomes true. "
127 "Other B<futex>() operations can be used to wake any processes or threads "
128 "waiting for a particular condition."
129 msgstr ""
130 "L'appel système B<futex>() offre une méthode pour attendre qu'une condition "
131 "soit vraie. On l'utilise en général comme construction de blocage dans le "
132 "contexte de la synchronisation de la mémoire partagée. Quand on utilise des "
133 "futex, la majorité des opérations de synchronisation s'effectue dans "
134 "l'espace utilisateur. Un programme de l'espace utilisateur n'utilise l'appel "
135 "système B<futex>() que lorsqu'il est probable qu'il doive se bloquer plus "
136 "longtemps avant que la condition ne soit vraie. D'autres opérations "
137 "B<futex>() peuvent être utilisées pour réveiller des processus ou des "
138 "threads qui attendent une condition en particulier."
139
140 #. type: Plain text
141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
143 msgid ""
144 "A futex is a 32-bit value\\[em]referred to below as a I<futex word>\\"
145 "[em]whose address is supplied to the B<futex>() system call. (Futexes are "
146 "32 bits in size on all platforms, including 64-bit systems.) All futex "
147 "operations are governed by this value. In order to share a futex between "
148 "processes, the futex is placed in a region of shared memory, created using "
149 "(for example) B<mmap>(2) or B<shmat>(2). (Thus, the futex word may have "
150 "different virtual addresses in different processes, but these addresses all "
151 "refer to the same location in physical memory.) In a multithreaded program, "
152 "it is sufficient to place the futex word in a global variable shared by all "
153 "threads."
154 msgstr ""
155 "Un futex est une valeur 32 bits — désignée ci-dessous comme « I<mot "
156 "futex> » —dont l'adresse est fournie à l'appel système B<futex>() (les futex "
157 "ont une taille de 32 bits sur toutes les plateformes, y compris les systèmes "
158 "64 bits). Toutes les opérations futex sont pilotées par cette valeur. Afin "
159 "de partager un futex entre des processus, le futex est placé dans une zone "
160 "de la mémoire partagée créée en utilisant (par exemple) B<mmap>(2) ou "
161 "B<shmat>(2) (ainsi, le mot futex peut avoir plusieurs adresses virtuelles "
162 "dans différents processus, mais ces adresses se rapportent toutes au même "
163 "emplacement de la mémoire physique). Dans un programme multithreadé, il "
164 "suffit de mettre le mot futex dans une variable globale partagée par tous "
165 "les threads."
166
167 #
168 #. #-#-#-#-# archlinux: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
169 #. Notes from Darren Hart (Dec 2015):
170 #. Totally ordered with respect futex operations refers to semantics
171 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
172 #. memory reads and writes. The kernel futex operations are protected
173 #. by spinlocks, which ensure that all operations are serialized
174 #. with respect to one another.
175 #. This is a lot to attempt to define in this document. Perhaps a
176 #. reference to linux/Documentation/memory-barriers.txt as a footnote
177 #. would be sufficient? Or perhaps for this manual, "serialized" would
178 #. be sufficient, with a footnote regarding "totally ordered" and a
179 #. pointer to the memory-barrier documentation?
180 #. FIXME(Torvald Riegel):
181 #. Eventually we want to have some text in NOTES to satisfy
182 #. the reference in the following sentence
183 #. See NOTES for a detailed specification of
184 #. the synchronization semantics.
185 #. type: Plain text
186 #. #-#-#-#-# debian-trixie: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
187 #. Notes from Darren Hart (Dec 2015):
188 #. Totally ordered with respect futex operations refers to semantics
189 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
190 #. memory reads and writes. The kernel futex operations are protected
191 #. by spinlocks, which ensure that all operations are serialized
192 #. with respect to one another.
193 #. This is a lot to attempt to define in this document. Perhaps a
194 #. reference to linux/Documentation/memory-barriers.txt as a footnote
195 #. would be sufficient? Or perhaps for this manual, "serialized" would
196 #. be sufficient, with a footnote regarding "totally ordered" and a
197 #. pointer to the memory-barrier documentation?
198 #. FIXME(Torvald Riegel):
199 #. Eventually we want to have some text in NOTES to satisfy
200 #. the reference in the following sentence
201 #. See NOTES for a detailed specification of
202 #. the synchronization semantics.
203 #. type: Plain text
204 #. #-#-#-#-# debian-unstable: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
205 #. Notes from Darren Hart (Dec 2015):
206 #. Totally ordered with respect futex operations refers to semantics
207 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
208 #. memory reads and writes. The kernel futex operations are protected
209 #. by spinlocks, which ensure that all operations are serialized
210 #. with respect to one another.
211 #. This is a lot to attempt to define in this document. Perhaps a
212 #. reference to linux/Documentation/memory-barriers.txt as a footnote
213 #. would be sufficient? Or perhaps for this manual, "serialized" would
214 #. be sufficient, with a footnote regarding "totally ordered" and a
215 #. pointer to the memory-barrier documentation?
216 #. FIXME(Torvald Riegel):
217 #. Eventually we want to have some text in NOTES to satisfy
218 #. the reference in the following sentence
219 #. See NOTES for a detailed specification of
220 #. the synchronization semantics.
221 #. type: Plain text
222 #. #-#-#-#-# fedora-44: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
223 #. Notes from Darren Hart (Dec 2015):
224 #. Totally ordered with respect futex operations refers to semantics
225 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
226 #. memory reads and writes. The kernel futex operations are protected
227 #. by spinlocks, which ensure that all operations are serialized
228 #. with respect to one another.
229 #. This is a lot to attempt to define in this document. Perhaps a
230 #. reference to linux/Documentation/memory-barriers.txt as a footnote
231 #. would be sufficient? Or perhaps for this manual, "serialized" would
232 #. be sufficient, with a footnote regarding "totally ordered" and a
233 #. pointer to the memory-barrier documentation?
234 #. FIXME(Torvald Riegel):
235 #. Eventually we want to have some text in NOTES to satisfy
236 #. the reference in the following sentence
237 #. See NOTES for a detailed specification of
238 #. the synchronization semantics.
239 #. type: Plain text
240 #. #-#-#-#-# fedora-rawhide: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
241 #. Notes from Darren Hart (Dec 2015):
242 #. Totally ordered with respect futex operations refers to semantics
243 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
244 #. memory reads and writes. The kernel futex operations are protected
245 #. by spinlocks, which ensure that all operations are serialized
246 #. with respect to one another.
247 #. This is a lot to attempt to define in this document. Perhaps a
248 #. reference to linux/Documentation/memory-barriers.txt as a footnote
249 #. would be sufficient? Or perhaps for this manual, "serialized" would
250 #. be sufficient, with a footnote regarding "totally ordered" and a
251 #. pointer to the memory-barrier documentation?
252 #. FIXME(Torvald Riegel):
253 #. Eventually we want to have some text in NOTES to satisfy
254 #. the reference in the following sentence
255 #. See NOTES for a detailed specification of
256 #. the synchronization semantics.
257 #. type: Plain text
258 #. #-#-#-#-# mageia-cauldron: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
259 #. Notes from Darren Hart (Dec 2015):
260 #. Totally ordered with respect futex operations refers to semantics
261 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
262 #. memory reads and writes. The kernel futex operations are protected
263 #. by spinlocks, which ensure that all operations are serialized
264 #. with respect to one another.
265 #. This is a lot to attempt to define in this document. Perhaps a
266 #. reference to linux/Documentation/memory-barriers.txt as a footnote
267 #. would be sufficient? Or perhaps for this manual, "serialized" would
268 #. be sufficient, with a footnote regarding "totally ordered" and a
269 #. pointer to the memory-barrier documentation?
270 #. FIXME(Torvald Riegel):
271 #. Eventually we want to have some text in NOTES to satisfy
272 #. the reference in the following sentence
273 #. See NOTES for a detailed specification of
274 #. the synchronization semantics.
275 #. type: Plain text
276 #. #-#-#-#-# opensuse-leap-16-1: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
277 #. Notes from Darren Hart (Dec 2015):
278 #. Totally ordered with respect futex operations refers to semantics
279 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
280 #. memory reads and writes. The kernel futex operations are protected
281 #. by spinlocks, which ensure that all operations are serialized
282 #. with respect to one another.
283 #. This is a lot to attempt to define in this document. Perhaps a
284 #. reference to linux/Documentation/memory-barriers.txt as a footnote
285 #. would be sufficient? Or perhaps for this manual, "serialized" would
286 #. be sufficient, with a footnote regarding "totally ordered" and a
287 #. pointer to the memory-barrier documentation?
288 #. FIXME(Torvald Riegel):
289 #. Eventually we want to have some text in NOTES to satisfy
290 #. the reference in the following sentence
291 #. See NOTES for a detailed specification of
292 #. the synchronization semantics.
293 #. type: Plain text
294 #. #-#-#-#-# opensuse-tumbleweed: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
295 #. Notes from Darren Hart (Dec 2015):
296 #. Totally ordered with respect futex operations refers to semantics
297 #. of the ACQUIRE/RELEASE operations and how they impact ordering of
298 #. memory reads and writes. The kernel futex operations are protected
299 #. by spinlocks, which ensure that all operations are serialized
300 #. with respect to one another.
301 #. This is a lot to attempt to define in this document. Perhaps a
302 #. reference to linux/Documentation/memory-barriers.txt as a footnote
303 #. would be sufficient? Or perhaps for this manual, "serialized" would
304 #. be sufficient, with a footnote regarding "totally ordered" and a
305 #. pointer to the memory-barrier documentation?
306 #. FIXME(Torvald Riegel):
307 #. Eventually we want to have some text in NOTES to satisfy
308 #. the reference in the following sentence
309 #. See NOTES for a detailed specification of
310 #. the synchronization semantics.
311 #. type: Plain text
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 msgid ""
315 "When executing a futex operation that requests to block a thread, the kernel "
316 "will block only if the futex word has the value that the calling thread "
317 "supplied (as one of the arguments of the B<futex>() call) as the expected "
318 "value of the futex word. The loading of the futex word's value, the "
319 "comparison of that value with the expected value, and the actual blocking "
320 "will happen atomically and will be totally ordered with respect to "
321 "concurrent operations performed by other threads on the same futex word. "
322 "Thus, the futex word is used to connect the synchronization in user space "
323 "with the implementation of blocking by the kernel. Analogously to an atomic "
324 "compare-and-exchange operation that potentially changes shared memory, "
325 "blocking via a futex is an atomic compare-and-block operation."
326 msgstr ""
327 "Lors de l'exécution d'une opération futex qui demande le blocage d'un "
328 "thread, le noyau ne le bloquera que si le mot futex a une valeur fournie par "
329 "le thread appelant (en tant qu'un des paramètres de l'appel B<futex>()) "
330 "correspondant à celle prévue du mot futex. Le chargement de la valeur du mot "
331 "futex, la comparaison de cette valeur avec celle attendue et le blocage "
332 "s'effectueront de manière atomique et seront entièrement organisés par "
333 "rapport aux opérations qui sont effectuées en parallèle par d'autres threads "
334 "sur le même mot futex. Ainsi, le mot futex est utilisé pour relier la "
335 "synchronisation de l'espace utilisateur et l'implémentation du blocage par "
336 "le noyau. Tout comme une opération compare-and-exchange atomique qui modifie "
337 "potentiellement la mémoire partagée, le blocage par futex est une opération "
338 "compare-and-block atomique."
339
340 #. type: Plain text
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 msgid ""
344 "One use of futexes is for implementing locks. The state of the lock (i.e., "
345 "acquired or not acquired) can be represented as an atomically accessed flag "
346 "in shared memory. In the uncontended case, a thread can access or modify "
347 "the lock state with atomic instructions, for example atomically changing it "
348 "from not acquired to acquired using an atomic compare-and-exchange "
349 "instruction. (Such instructions are performed entirely in user mode, and "
350 "the kernel maintains no information about the lock state.) On the other "
351 "hand, a thread may be unable to acquire a lock because it is already "
352 "acquired by another thread. It then may pass the lock's flag as a futex "
353 "word and the value representing the acquired state as the expected value to "
354 "a B<futex>() wait operation. This B<futex>() operation will block if and "
355 "only if the lock is still acquired (i.e., the value in the futex word still "
356 "matches the \"acquired state\"). When releasing the lock, a thread has to "
357 "first reset the lock state to not acquired and then execute a futex "
358 "operation that wakes threads blocked on the lock flag used as a futex word "
359 "(this can be further optimized to avoid unnecessary wake-ups). See "
360 "B<futex>(7) for more detail on how to use futexes."
361 msgstr ""
362 "Une utilisation des futex consiste à implémenter des verrous. L'état du "
363 "verrou (c'est-à-dire acquis ou non acquis) peut se représenter comme un "
364 "drapeau auquel on a un accès atomique en mémoire partagée. En absence de "
365 "conflit (uncontended case), un thread peut accéder et modifier l'état du "
366 "verrou avec des instructions atomiques, par exemple le passer de manière "
367 "atomique de l'état non acquis à acquis, en utilisant une instruction compare-"
368 "and-exchange atomique (de telles instructions s'effectuent entièrement dans "
369 "l'espace utilisateur et le noyau ne conserve aucune information sur l'état "
370 "du verrou). D'un autre côté, un thread peut être incapable d'acquérir un "
371 "verrou parce qu'il est déjà acquis par un autre thread. Il peut alors passer "
372 "l'attribut du verrou en tant que mot futex, et la valeur représentant l'état "
373 "acquis en tant que valeur attendue pour l'opération d'attente de B<futex>(). "
374 "Cette opération B<futex>() bloquera si et seulement si le verrou est encore "
375 "acquis (c'est-à-dire si la valeur du mot futex correspond toujours à "
376 "« l'état acquis »). Lorsque le verrou est relâché, le thread doit d'abord "
377 "réinitialiser l'état du verrou sur non acquis puis exécuter une opération "
378 "futex qui réveille les threads bloqués par le drapeau de verrou utilisé en "
379 "tant que mot futex (cela peut être mieux optimisé pour éviter les réveils "
380 "inutiles). Voir B<futex>(7) pour plus de détails sur la manière d'utiliser "
381 "les futex."
382
383 #. type: Plain text
384 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
385 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
386 msgid ""
387 "Besides the basic wait and wake-up futex functionality, there are further "
388 "futex operations aimed at supporting more complex use cases."
389 msgstr ""
390 "Outre la fonctionnalité de base du futex consistant à attendre et à "
391 "réveiller, d'autres opérations futex visent à gérer des cas d'utilisation "
392 "plus complexes."
393
394 #. type: Plain text
395 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
396 #: opensuse-tumbleweed
397 #, fuzzy
398 #| msgid ""
399 #| "Note that no explicit initialization or destruction is necessary to use "
400 #| "futexes; the kernel maintains a futex (i.e., the kernel-internal "
401 #| "implementation artifact) only while operations such as B<FUTEX_WAIT>, "
402 #| "described below, are being performed on a particular futex word."
403 msgid ""
404 "Note that no explicit initialization or destruction is necessary to use "
405 "futexes; the kernel maintains a futex (i.e., the kernel-internal "
406 "implementation artifact) only while operations such as "
407 "B<FUTEX_WAIT>(2const) are being performed on a particular futex word."
408 msgstr ""
409 "Remarquez qu'aucune initialisation ou destruction explicite n'est nécessaire "
410 "pour utiliser les futex ; le noyau ne garde un futex (c'est-à-dire un "
411 "artefact d'implémentation interne au noyau) que pendant que les opérations "
412 "telles que B<FUTEX_WAIT>, décrite ci-dessous, s'effectuent sur un mot futex "
413 "en particulier."
414
415 #. type: SS
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, no-wrap
419 msgid "Arguments"
420 msgstr "Argument"
421
422 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
423 #. type: Plain text
424 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
425 #: opensuse-tumbleweed
426 #, fuzzy
427 #| msgid ""
428 #| "The I<uaddr> argument points to the futex word. On all platforms, "
429 #| "futexes are four-byte integers that must be aligned on a four-byte "
430 #| "boundary. The operation to perform on the futex is specified in the "
431 #| "I<futex_op> argument; I<val> is a value whose meaning and purpose depends "
432 #| "on I<futex_op>."
433 msgid ""
434 "The I<uaddr> argument points to the futex word. On all platforms, futexes "
435 "are four-byte integers that must be aligned on a four-byte boundary. The "
436 "operation to perform on the futex is specified in the I<op> argument."
437 msgstr ""
438 "Le paramètre I<uaddr> pointe vers un mot futex. Sur toutes les plateformes, "
439 "les futex sont des entiers de quatre octets qui doivent être alignés sur une "
440 "limite de quatre octets. L'opération à effectuer sur le futex est indiquée "
441 "dans le paramètre de I<futex_op> ; I<val> est une valeur dont la "
442 "signification et l'objectif dépendent de I<futex_op>."
443
444 #. type: SS
445 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
446 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
447 #, no-wrap
448 msgid "Futex operations"
449 msgstr "Opérations futex"
450
451 #. type: Plain text
452 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
453 #: opensuse-tumbleweed
454 #, fuzzy
455 #| msgid ""
456 #| "The I<futex_op> argument consists of two parts: a command that specifies "
457 #| "the operation to be performed, bitwise ORed with zero or more options "
458 #| "that modify the behaviour of the operation. The options that may be "
459 #| "included in I<futex_op> are as follows:"
460 msgid ""
461 "The I<op> argument consists of two parts: a command that specifies the "
462 "operation to be performed, bitwise ORed with zero or more options that "
463 "modify the behavior of the operation. The options that may be included in "
464 "I<op> are as follows:"
465 msgstr ""
466 "Le paramètre I<futex_op> est en deux parties : une commande qui indique "
467 "l'opération à effectuer et un bit ORed avec zéro ou plusieurs options qui "
468 "changent le comportement de l'opération. Les options qui peuvent être "
469 "incluses dans I<futex_op> sont les suivantes :"
470
471 #. type: TP
472 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
473 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
474 #, no-wrap
475 msgid "B<FUTEX_PRIVATE_FLAG> (since Linux 2.6.22)"
476 msgstr "B<FUTEX_PRIVATE_FLAG> (depuis Linux 2.6.22)"
477
478 #. commit 34f01cc1f512fa783302982776895c73714ebbc2
479 #. I.e., It allows the kernel choose the fast path for validating
480 #. the user-space address and avoids expensive VMA lookups,
481 #. taking reference counts on file backing store, and so on.
482 #. type: Plain text
483 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
484 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
485 msgid ""
486 "This option bit can be employed with all futex operations. It tells the "
487 "kernel that the futex is process-private and not shared with another process "
488 "(i.e., it is being used for synchronization only between threads of the same "
489 "process). This allows the kernel to make some additional performance "
490 "optimizations."
491 msgstr ""
492 "Ce bit d'option peut être utilisé avec toutes les opérations futex. Il dit "
493 "au noyau que le futex est un processus privé non partagé avec d'autres "
494 "processus (c'est-à-dire qu'il n'est utilisé que pour la synchronisation "
495 "entre les threads du même processus). Cela permet au noyau d'effectuer des "
496 "optimisations de performance supplémentaires."
497
498 #. #-#-#-#-# archlinux: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
499 #. except the obsolete FUTEX_FD(2const), for which the "private" flag was
500 #. meaningless
501 #. type: Plain text
502 #. #-#-#-#-# debian-trixie: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
503 #. except the obsolete FUTEX_FD, for which the "private" flag was
504 #. meaningless
505 #. type: Plain text
506 #. #-#-#-#-# debian-unstable: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
507 #. except the obsolete FUTEX_FD(2const), for which the "private" flag was
508 #. meaningless
509 #. type: Plain text
510 #. #-#-#-#-# fedora-44: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
511 #. except the obsolete FUTEX_FD, for which the "private" flag was
512 #. meaningless
513 #. type: Plain text
514 #. #-#-#-#-# fedora-rawhide: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
515 #. except the obsolete FUTEX_FD, for which the "private" flag was
516 #. meaningless
517 #. type: Plain text
518 #. #-#-#-#-# mageia-cauldron: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
519 #. except the obsolete FUTEX_FD(2const), for which the "private" flag was
520 #. meaningless
521 #. type: Plain text
522 #. #-#-#-#-# opensuse-leap-16-1: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
523 #. except the obsolete FUTEX_FD(2const), for which the "private" flag was
524 #. meaningless
525 #. type: Plain text
526 #. #-#-#-#-# opensuse-tumbleweed: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
527 #. except the obsolete FUTEX_FD(2const), for which the "private" flag was
528 #. meaningless
529 #. type: Plain text
530 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
531 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
532 msgid ""
533 "As a convenience, I<E<lt>linux/futex.hE<gt>> defines a set of constants with "
534 "the suffix B<_PRIVATE> that are equivalents of all of the operations listed "
535 "below, but with the B<FUTEX_PRIVATE_FLAG> ORed into the constant value. "
536 "Thus, there are B<FUTEX_WAIT_PRIVATE>, B<FUTEX_WAKE_PRIVATE>, and so on."
537 msgstr ""
538 "Par commodité, I<E<lt>linux/futex.hE<gt>> définit un ensemble de constantes "
539 "dont le suffixe est B<_PRIVATE> et qui sont équivalentes à toutes les "
540 "opérations listées ci-dessous mais avec l'attribut B<FUTEX_PRIVATE_FLAG> "
541 "ORed dans la valeur de la constante. On trouve ainsi B<FUTEX_WAIT_PRIVATE>, "
542 "B<FUTEX_WAKE_PRIVATE> et ainsi de suite."
543
544 #. type: TP
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 #, no-wrap
548 msgid "B<FUTEX_CLOCK_REALTIME> (since Linux 2.6.28)"
549 msgstr "B<FUTEX_CLOCK_REALTIME> (depuis Linux 2.6.28)"
550
551 #. commit 1acdac104668a0834cfa267de9946fac7764d486
552 #. commit 337f13046ff03717a9e99675284a817527440a49
553 #. commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
554 #. type: Plain text
555 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
556 #: opensuse-tumbleweed
557 #, fuzzy
558 #| msgid ""
559 #| "This option bit can be employed only with the B<FUTEX_WAIT_BITSET>, "
560 #| "B<FUTEX_WAIT_REQUEUE_PI>, (since Linux 4.5) B<FUTEX_WAIT>, and (since "
561 #| "Linux 5.14) B<FUTEX_LOCK_PI2> operations."
562 msgid ""
563 "This option bit can be employed only with the B<FUTEX_WAIT_BITSET>(2const), "
564 "B<FUTEX_WAIT_REQUEUE_PI>(2const), (since Linux 4.5) B<FUTEX_WAIT>(2const), "
565 "and (since Linux 5.14) B<FUTEX_LOCK_PI2>(2const) operations."
566 msgstr ""
567 "Ce bit d'option ne peut être utilisé qu'avec les opérations "
568 "B<FUTEX_WAIT_BITSET>, B<FUTEX_WAIT_REQUEUE_PI> (depuis Linux 4.5), "
569 "B<FUTEX_WAIT> (depuis Linux 4.5) et B<FUTEX_LOCK_PI2> (depuis Linux 5.14)."
570
571 #. type: Plain text
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 msgid ""
575 "If this option is set, the kernel measures the I<timeout> against the "
576 "B<CLOCK_REALTIME> clock."
577 msgstr ""
578 "Si cette option est positionnée, le noyau mesure le I<timeout> par rapport à "
579 "l'horloge B<CLOCK_REALTIME>."
580
581 #. type: Plain text
582 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
583 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
584 msgid ""
585 "If this option is not set, the kernel measures the I<timeout> against the "
586 "B<CLOCK_MONOTONIC> clock."
587 msgstr ""
588 "Si cette option n'est pas positionnée, le noyau mesure le I<timeout> par "
589 "rapport à l'horloge B<CLOCK_MONOTONIC>."
590
591 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
592 #. type: Plain text
593 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
594 #: opensuse-tumbleweed
595 #, fuzzy
596 #| msgid "The operation specified in I<futex_op> is one of the following:"
597 msgid "The operation specified in I<op> is one of the following:"
598 msgstr "L'opération indiquée dans I<futex_op> prend une de ces valeurs\\ :"
599
600 #. type: TP
601 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
602 #: opensuse-tumbleweed
603 #, fuzzy, no-wrap
604 #| msgid "B<FUTEX_WAIT>"
605 msgid "B<FUTEX_WAIT>(2const)"
606 msgstr "B<FUTEX_WAIT>"
607
608 #. type: TQ
609 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
610 #: opensuse-tumbleweed
611 #, fuzzy, no-wrap
612 #| msgid "B<FUTEX_WAKE>"
613 msgid "B<FUTEX_WAKE>(2const)"
614 msgstr "B<FUTEX_WAKE>"
615
616 #. type: TQ
617 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
618 #: opensuse-tumbleweed
619 #, fuzzy, no-wrap
620 #| msgid "B<FUTEX_FD>"
621 msgid "B<FUTEX_FD>(2const)"
622 msgstr "B<FUTEX_FD>"
623
624 #. type: TQ
625 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
626 #: opensuse-tumbleweed
627 #, fuzzy, no-wrap
628 #| msgid "B<FUTEX_REQUEUE>"
629 msgid "B<FUTEX_REQUEUE>(2const)"
630 msgstr "B<FUTEX_REQUEUE>"
631
632 #. type: TQ
633 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
634 #: opensuse-tumbleweed
635 #, fuzzy, no-wrap
636 #| msgid "B<FUTEX_CMP_REQUEUE>"
637 msgid "B<FUTEX_CMP_REQUEUE>(2const)"
638 msgstr "B<FUTEX_CMP_REQUEUE>"
639
640 #. type: TQ
641 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
642 #: opensuse-tumbleweed
643 #, fuzzy, no-wrap
644 #| msgid "B<FUTEX_WAKE_OP>"
645 msgid "B<FUTEX_WAKE_OP>(2const)"
646 msgstr "B<FUTEX_WAKE_OP>"
647
648 #. type: TQ
649 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
650 #: opensuse-tumbleweed
651 #, fuzzy, no-wrap
652 #| msgid "B<FUTEX_WAIT_BITSET>"
653 msgid "B<FUTEX_WAIT_BITSET>(2const)"
654 msgstr "B<FUTEX_WAIT_BITSET>"
655
656 #. type: TQ
657 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
658 #: opensuse-tumbleweed
659 #, fuzzy, no-wrap
660 #| msgid "B<FUTEX_WAKE_BITSET>"
661 msgid "B<FUTEX_WAKE_BITSET>(2const)"
662 msgstr "B<FUTEX_WAKE_BITSET>"
663
664 #. type: SS
665 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
666 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
667 #, no-wrap
668 msgid "Priority-inheritance futexes"
669 msgstr "Futex et héritage de priorité"
670
671 #. type: Plain text
672 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
673 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
674 msgid ""
675 "Linux supports priority-inheritance (PI) futexes in order to handle priority-"
676 "inversion problems that can be encountered with normal futex locks. "
677 "Priority inversion is the problem that occurs when a high-priority task is "
678 "blocked waiting to acquire a lock held by a low-priority task, while tasks "
679 "at an intermediate priority continuously preempt the low-priority task from "
680 "the CPU. Consequently, the low-priority task makes no progress toward "
681 "releasing the lock, and the high-priority task remains blocked."
682 msgstr ""
683 "Linux prend en charge l'héritage de priorité (priority inheritance, PI) des "
684 "futex, afin de gérer des problèmes d'inversion des priorités qu'on peut "
685 "rencontrer avec des verrous futex normaux. L'inversion des priorités est un "
686 "problème qui survient quand une tâche de haute priorité est bloquée en "
687 "attente d'acquérir un verrou que possède une tâche de basse priorité issue "
688 "du processeur. Du coup, la tâche de priorité basse ne va pas relâcher le "
689 "verrou et celle de haute priorité reste bloquée."
690
691 #. type: Plain text
692 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
693 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
694 msgid ""
695 "Priority inheritance is a mechanism for dealing with the priority-inversion "
696 "problem. With this mechanism, when a high-priority task becomes blocked by "
697 "a lock held by a low-priority task, the priority of the low-priority task is "
698 "temporarily raised to that of the high-priority task, so that it is not "
699 "preempted by any intermediate level tasks, and can thus make progress toward "
700 "releasing the lock. To be effective, priority inheritance must be "
701 "transitive, meaning that if a high-priority task blocks on a lock held by a "
702 "lower-priority task that is itself blocked by a lock held by another "
703 "intermediate-priority task (and so on, for chains of arbitrary length), then "
704 "both of those tasks (or more generally, all of the tasks in a lock chain) "
705 "have their priorities raised to be the same as the high-priority task."
706 msgstr ""
707 "L'héritage de priorité est un mécanisme pour gérer le problème d'inversion "
708 "des priorités. Avec ce mécanisme, quand une tâche à haute priorité est "
709 "bloquée par un verrou possédé par une tâche à basse priorité, la priorité de "
710 "la seconde est temporairement amenée au même niveau que celle à haute "
711 "priorité, de sorte qu'elle ne soit pas doublée par une tâche de niveau "
712 "intermédiaire et qu'elle puisse ainsi avancer pour relâcher le verrou. Pour "
713 "fonctionner, l'héritage de priorité doit être transitif, ce qui signifie que "
714 "si une tâche à haute priorité bloque sur le verrou d'une tâche à priorité "
715 "intermédiaire (et ainsi de suite sur des chaînes de la taille de votre "
716 "choix), les deux tâches (ou plus généralement toutes les tâches de la chaîne "
717 "de verrous) voient leur niveau de priorité amené à celui de la tâche à haute "
718 "priorité."
719
720 #
721 #. #-#-#-#-# archlinux: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
722 #. Quoting Darren Hart:
723 #. These opcodes paired with the PI futex value policy (described below)
724 #. defines a "futex" as PI aware. These were created very specifically
725 #. in support of PI pthread_mutexes, so it makes a lot more sense to
726 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
727 #. there is a lot of policy and scaffolding that has to be built up
728 #. around it to use it properly (this is what a PI pthread_mutex is).
729 #. type: Plain text
730 #. #-#-#-#-# debian-trixie: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
731 #. Quoting Darren Hart:
732 #. These opcodes paired with the PI futex value policy (described below)
733 #. defines a "futex" as PI aware. These were created very specifically
734 #. in support of PI pthread_mutexes, so it makes a lot more sense to
735 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
736 #. there is a lot of policy and scaffolding that has to be built up
737 #. around it to use it properly (this is what a PI pthread_mutex is).
738 #. type: Plain text
739 #. #-#-#-#-# debian-unstable: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
740 #. Quoting Darren Hart:
741 #. These opcodes paired with the PI futex value policy (described below)
742 #. defines a "futex" as PI aware. These were created very specifically
743 #. in support of PI pthread_mutexes, so it makes a lot more sense to
744 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
745 #. there is a lot of policy and scaffolding that has to be built up
746 #. around it to use it properly (this is what a PI pthread_mutex is).
747 #. type: Plain text
748 #. #-#-#-#-# fedora-44: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
749 #. Quoting Darren Hart:
750 #. These opcodes paired with the PI futex value policy (described below)
751 #. defines a "futex" as PI aware. These were created very specifically
752 #. in support of PI pthread_mutexes, so it makes a lot more sense to
753 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
754 #. there is a lot of policy and scaffolding that has to be built up
755 #. around it to use it properly (this is what a PI pthread_mutex is).
756 #. type: Plain text
757 #. #-#-#-#-# fedora-rawhide: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
758 #. Quoting Darren Hart:
759 #. These opcodes paired with the PI futex value policy (described below)
760 #. defines a "futex" as PI aware. These were created very specifically
761 #. in support of PI pthread_mutexes, so it makes a lot more sense to
762 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
763 #. there is a lot of policy and scaffolding that has to be built up
764 #. around it to use it properly (this is what a PI pthread_mutex is).
765 #. type: Plain text
766 #. #-#-#-#-# mageia-cauldron: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
767 #. Quoting Darren Hart:
768 #. These opcodes paired with the PI futex value policy (described below)
769 #. defines a "futex" as PI aware. These were created very specifically
770 #. in support of PI pthread_mutexes, so it makes a lot more sense to
771 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
772 #. there is a lot of policy and scaffolding that has to be built up
773 #. around it to use it properly (this is what a PI pthread_mutex is).
774 #. type: Plain text
775 #. #-#-#-#-# opensuse-leap-16-1: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
776 #. Quoting Darren Hart:
777 #. These opcodes paired with the PI futex value policy (described below)
778 #. defines a "futex" as PI aware. These were created very specifically
779 #. in support of PI pthread_mutexes, so it makes a lot more sense to
780 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
781 #. there is a lot of policy and scaffolding that has to be built up
782 #. around it to use it properly (this is what a PI pthread_mutex is).
783 #. type: Plain text
784 #. #-#-#-#-# opensuse-tumbleweed: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
785 #. Quoting Darren Hart:
786 #. These opcodes paired with the PI futex value policy (described below)
787 #. defines a "futex" as PI aware. These were created very specifically
788 #. in support of PI pthread_mutexes, so it makes a lot more sense to
789 #. talk about a PI aware pthread_mutex, than a PI aware futex, since
790 #. there is a lot of policy and scaffolding that has to be built up
791 #. around it to use it properly (this is what a PI pthread_mutex is).
792 #. type: Plain text
793 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
794 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
795 msgid ""
796 "From a user-space perspective, what makes a futex PI-aware is a policy "
797 "agreement (described below) between user space and the kernel about the "
798 "value of the futex word, coupled with the use of the PI-futex operations "
799 "described below. (Unlike the other futex operations described above, the PI-"
800 "futex operations are designed for the implementation of very specific IPC "
801 "mechanisms.)"
802 msgstr ""
803 "Du point de vue de l'espace utilisateur, le futex a conscience d'un PI en "
804 "acceptant une réglementation (décrite ci-dessous) entre l'espace utilisateur "
805 "et le noyau sur la valeur du mot futex, couplé à l'utilisation d'opérations "
806 "futex PI décrites ci-dessous (contrairement aux autres opérations futex "
807 "décrites ci-dessus, celles PI-futex sont conçues pour l'implémentation de "
808 "mécanismes IPC très spécifiques)."
809
810 #. mtk: The following text is drawn from the Hart/Guniguntala paper
811 #. (listed in SEE ALSO), but I have reworded some pieces
812 #. significantly.
813 #. type: Plain text
814 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
815 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
816 msgid ""
817 "The PI-futex operations described below differ from the other futex "
818 "operations in that they impose policy on the use of the value of the futex "
819 "word:"
820 msgstr ""
821 "Les opérations PI-futex décrites ci-dessous diffèrent des autres opérations "
822 "dans le sens où elles imposent des règles dans l'utilisation de la valeur du "
823 "mot futex :"
824
825 #. type: IP
826 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
827 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
828 #, no-wrap
829 msgid "\\[bu]"
830 msgstr "-"
831
832 #. type: Plain text
833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
835 msgid "If the lock is not acquired, the futex word's value shall be 0."
836 msgstr "Si le verrou n'est pas acquis, la valeur du mot futex doit être B<0>."
837
838 #. type: Plain text
839 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
840 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
841 msgid ""
842 "If the lock is acquired, the futex word's value shall be the thread ID (TID; "
843 "see B<gettid>(2)) of the owning thread."
844 msgstr ""
845 "Si le verrou est acquis, la valeur du mot futex doit être l'ID du thread "
846 "(TID ; voir B<gettid>(2)) du thread propriétaire."
847
848 #. type: Plain text
849 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
850 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
851 msgid ""
852 "If the lock is owned and there are threads contending for the lock, then the "
853 "B<FUTEX_WAITERS> bit shall be set in the futex word's value; in other words, "
854 "this value is:"
855 msgstr ""
856 "Si le verrou a un propriétaire et s'il y a des threads en concurrence pour "
857 "le verrou, le bit B<FUTEX_WAITERS> doit être positionné dans la valeur du "
858 "mot futex ; autrement dit, cette valeur est :"
859
860 #. type: Plain text
861 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
862 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
863 #, no-wrap
864 msgid "FUTEX_WAITERS | TID\n"
865 msgstr "FUTEX_WAITERS | TID\n"
866
867 #. type: Plain text
868 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
869 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
870 msgid ""
871 "(Note that is invalid for a PI futex word to have no owner and "
872 "B<FUTEX_WAITERS> set.)"
873 msgstr ""
874 "(Remarquez que cela n'est pas possible pour un mot futex PI d'être sans "
875 "propriétaire ni B<FUTEX_WAITERS> défini)."
876
877 #. type: Plain text
878 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
879 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
880 msgid ""
881 "With this policy in place, a user-space application can acquire an "
882 "unacquired lock or release a lock using atomic instructions executed in user "
883 "mode (e.g., a compare-and-swap operation such as I<cmpxchg> on the x86 "
884 "architecture). Acquiring a lock simply consists of using compare-and-swap "
885 "to atomically set the futex word's value to the caller's TID if its previous "
886 "value was 0. Releasing a lock requires using compare-and-swap to set the "
887 "futex word's value to 0 if the previous value was the expected TID."
888 msgstr ""
889 "Avec cette règle, une application de l'espace utilisateur peut acquérir un "
890 "verrou non acquis ou en relâcher un en utilisant des instructions atomiques "
891 "dans l'espace utilisateur (comme une opération compare-and-swap telle que "
892 "I<cmpxchg> sur l'architecture x86). L'acquisition d'un verrou consiste "
893 "simplement dans l'utilisation de compare-and-swap pour positionner la valeur "
894 "du mot futex de manière atomique sur le TID de l'appelant si sa valeur "
895 "précédente était B<0>. Relâcher un verrou exige d'utiliser compare-and-swap "
896 "pour positionner la valeur du mot futex sur B<0> si la valeur précédente "
897 "était le TID prévu."
898
899 #. type: Plain text
900 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
901 #: opensuse-tumbleweed
902 #, fuzzy
903 #| msgid ""
904 #| "If a futex is already acquired (i.e., has a nonzero value), waiters must "
905 #| "employ the B<FUTEX_LOCK_PI> or B<FUTEX_LOCK_PI2> operations to acquire "
906 #| "the lock. If other threads are waiting for the lock, then the "
907 #| "B<FUTEX_WAITERS> bit is set in the futex value; in this case, the lock "
908 #| "owner must employ the B<FUTEX_UNLOCK_PI> operation to release the lock."
909 msgid ""
910 "If a futex is already acquired (i.e., has a nonzero value), waiters must "
911 "employ the B<FUTEX_LOCK_PI>(2const) or B<FUTEX_LOCK_PI2>(2const) "
912 "operations to acquire the lock. If other threads are waiting for the lock, "
913 "then the B<FUTEX_WAITERS> bit is set in the futex value; in this case, the "
914 "lock owner must employ the B<FUTEX_UNLOCK_PI>(2const) operation to release "
915 "the lock."
916 msgstr ""
917 "Si un futex est déjà acquis (c'est-à-dire qu'il a une valeur positive), les "
918 "éléments en attente doivent utiliser l'opération B<FUTEX_LOCK_PI> pour "
919 "acquérir le verrou. Si d'autres threads attendent le verrou, le bit "
920 "B<FUTEX_WAITERS> est défini dans la valeur du futex ; dans ce cas le "
921 "détenteur du verrou doit utiliser l'opération B<FUTEX_UNLOCK_PI> pour "
922 "relâcher le verrou."
923
924 #. type: Plain text
925 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
926 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
927 msgid ""
928 "In the cases where callers are forced into the kernel (i.e., required to "
929 "perform a B<futex>() call), they then deal directly with a so-called RT-"
930 "mutex, a kernel locking mechanism which implements the required priority-"
931 "inheritance semantics. After the RT-mutex is acquired, the futex value is "
932 "updated accordingly, before the calling thread returns to user space."
933 msgstr ""
934 "Dans le cas où les appelants sont bloqués dans le noyau (c'est-à-dire qu'ils "
935 "doivent effectuer un appel B<futex>()), ils traitent directement avec ce "
936 "qu'on appelle un RT-mutex, un mécanisme de verrouillage du noyau qui "
937 "implémente la sémantique de l'héritage de priorité requis. Après que le RT-"
938 "mutex est acquis, la valeur futex est mise à jour en fonction, avant que le "
939 "thread appelant ne renvoie vers l'espace utilisateur."
940
941 #. #-#-#-#-# archlinux: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
942 #. tglx (July 2015):
943 #. If there are multiple waiters on a pi futex then a wake pi operation
944 #. will wake the first waiter and hand over the lock to this waiter. This
945 #. includes handing over the rtmutex which represents the futex in the
946 #. kernel. The strict requirement is that the futex owner and the rtmutex
947 #. owner must be the same, except for the update period which is
948 #. serialized by the futex internal locking. That means the kernel must
949 #. update the user-space value prior to returning to user space
950 #. type: Plain text
951 #. #-#-#-#-# debian-trixie: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
952 #. tglx (July 2015):
953 #. If there are multiple waiters on a pi futex then a wake pi operation
954 #. will wake the first waiter and hand over the lock to this waiter. This
955 #. includes handing over the rtmutex which represents the futex in the
956 #. kernel. The strict requirement is that the futex owner and the rtmutex
957 #. owner must be the same, except for the update period which is
958 #. serialized by the futex internal locking. That means the kernel must
959 #. update the user-space value prior to returning to user space
960 #. type: Plain text
961 #. #-#-#-#-# debian-unstable: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
962 #. tglx (July 2015):
963 #. If there are multiple waiters on a pi futex then a wake pi operation
964 #. will wake the first waiter and hand over the lock to this waiter. This
965 #. includes handing over the rtmutex which represents the futex in the
966 #. kernel. The strict requirement is that the futex owner and the rtmutex
967 #. owner must be the same, except for the update period which is
968 #. serialized by the futex internal locking. That means the kernel must
969 #. update the user-space value prior to returning to user space
970 #. type: Plain text
971 #. #-#-#-#-# fedora-44: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
972 #. tglx (July 2015):
973 #. If there are multiple waiters on a pi futex then a wake pi operation
974 #. will wake the first waiter and hand over the lock to this waiter. This
975 #. includes handing over the rtmutex which represents the futex in the
976 #. kernel. The strict requirement is that the futex owner and the rtmutex
977 #. owner must be the same, except for the update period which is
978 #. serialized by the futex internal locking. That means the kernel must
979 #. update the user-space value prior to returning to user space
980 #. type: Plain text
981 #. #-#-#-#-# fedora-rawhide: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
982 #. tglx (July 2015):
983 #. If there are multiple waiters on a pi futex then a wake pi operation
984 #. will wake the first waiter and hand over the lock to this waiter. This
985 #. includes handing over the rtmutex which represents the futex in the
986 #. kernel. The strict requirement is that the futex owner and the rtmutex
987 #. owner must be the same, except for the update period which is
988 #. serialized by the futex internal locking. That means the kernel must
989 #. update the user-space value prior to returning to user space
990 #. type: Plain text
991 #. #-#-#-#-# mageia-cauldron: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
992 #. tglx (July 2015):
993 #. If there are multiple waiters on a pi futex then a wake pi operation
994 #. will wake the first waiter and hand over the lock to this waiter. This
995 #. includes handing over the rtmutex which represents the futex in the
996 #. kernel. The strict requirement is that the futex owner and the rtmutex
997 #. owner must be the same, except for the update period which is
998 #. serialized by the futex internal locking. That means the kernel must
999 #. update the user-space value prior to returning to user space
1000 #. type: Plain text
1001 #. #-#-#-#-# opensuse-leap-16-1: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1002 #. tglx (July 2015):
1003 #. If there are multiple waiters on a pi futex then a wake pi operation
1004 #. will wake the first waiter and hand over the lock to this waiter. This
1005 #. includes handing over the rtmutex which represents the futex in the
1006 #. kernel. The strict requirement is that the futex owner and the rtmutex
1007 #. owner must be the same, except for the update period which is
1008 #. serialized by the futex internal locking. That means the kernel must
1009 #. update the user-space value prior to returning to user space
1010 #. type: Plain text
1011 #. #-#-#-#-# opensuse-tumbleweed: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1012 #. tglx (July 2015):
1013 #. If there are multiple waiters on a pi futex then a wake pi operation
1014 #. will wake the first waiter and hand over the lock to this waiter. This
1015 #. includes handing over the rtmutex which represents the futex in the
1016 #. kernel. The strict requirement is that the futex owner and the rtmutex
1017 #. owner must be the same, except for the update period which is
1018 #. serialized by the futex internal locking. That means the kernel must
1019 #. update the user-space value prior to returning to user space
1020 #. type: Plain text
1021 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1022 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1023 msgid ""
1024 "It is important to note that the kernel will update the futex word's value "
1025 "prior to returning to user space. (This prevents the possibility of the "
1026 "futex word's value ending up in an invalid state, such as having an owner "
1027 "but the value being 0, or having waiters but not having the B<FUTEX_WAITERS> "
1028 "bit set.)"
1029 msgstr ""
1030 "Il est important de remarquer que le noyau mettra à jour la valeur du mot "
1031 "futex avant de renvoyer vers l'espace utilisateur (cela enlève la "
1032 "possibilité pour la valeur d'un mot futex de se terminer dans un état non "
1033 "valable, par exemple en ayant un propriétaire mais en ayant la valeur B<0>, "
1034 "ou en ayant des éléments en attente mais aucun bit B<FUTEX_WAITERS> "
1035 "positionné)."
1036
1037 #. #-#-#-#-# archlinux: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1038 #. tglx (July 2015):
1039 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1040 #. the kernel has no state associated. This happens via the robust futex
1041 #. mechanism. In that case the futex value will be set to
1042 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1043 #. PI futexes.
1044 #. type: Plain text
1045 #. #-#-#-#-# debian-trixie: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1046 #. tglx (July 2015):
1047 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1048 #. the kernel has no state associated. This happens via the robust futex
1049 #. mechanism. In that case the futex value will be set to
1050 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1051 #. PI futexes.
1052 #. type: Plain text
1053 #. #-#-#-#-# debian-unstable: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1054 #. tglx (July 2015):
1055 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1056 #. the kernel has no state associated. This happens via the robust futex
1057 #. mechanism. In that case the futex value will be set to
1058 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1059 #. PI futexes.
1060 #. type: Plain text
1061 #. #-#-#-#-# fedora-44: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1062 #. tglx (July 2015):
1063 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1064 #. the kernel has no state associated. This happens via the robust futex
1065 #. mechanism. In that case the futex value will be set to
1066 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1067 #. PI futexes.
1068 #. type: Plain text
1069 #. #-#-#-#-# fedora-rawhide: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1070 #. tglx (July 2015):
1071 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1072 #. the kernel has no state associated. This happens via the robust futex
1073 #. mechanism. In that case the futex value will be set to
1074 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1075 #. PI futexes.
1076 #. type: Plain text
1077 #. #-#-#-#-# mageia-cauldron: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1078 #. tglx (July 2015):
1079 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1080 #. the kernel has no state associated. This happens via the robust futex
1081 #. mechanism. In that case the futex value will be set to
1082 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1083 #. PI futexes.
1084 #. type: Plain text
1085 #. #-#-#-#-# opensuse-leap-16-1: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1086 #. tglx (July 2015):
1087 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1088 #. the kernel has no state associated. This happens via the robust futex
1089 #. mechanism. In that case the futex value will be set to
1090 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1091 #. PI futexes.
1092 #. type: Plain text
1093 #. #-#-#-#-# opensuse-tumbleweed: futex.2.pot (PACKAGE VERSION) #-#-#-#-#
1094 #. tglx (July 2015):
1095 #. The FUTEX_OWNER_DIED bit can also be set on uncontended futexes, where
1096 #. the kernel has no state associated. This happens via the robust futex
1097 #. mechanism. In that case the futex value will be set to
1098 #. FUTEX_OWNER_DIED. The robust futex mechanism is also available for non
1099 #. PI futexes.
1100 #. type: Plain text
1101 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1102 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1103 msgid ""
1104 "If a futex has an associated RT-mutex in the kernel (i.e., there are blocked "
1105 "waiters) and the owner of the futex/RT-mutex dies unexpectedly, then the "
1106 "kernel cleans up the RT-mutex and hands it over to the next waiter. This in "
1107 "turn requires that the user-space value is updated accordingly. To indicate "
1108 "that this is required, the kernel sets the B<FUTEX_OWNER_DIED> bit in the "
1109 "futex word along with the thread ID of the new owner. User space can detect "
1110 "this situation via the presence of the B<FUTEX_OWNER_DIED> bit and is then "
1111 "responsible for cleaning up the stale state left over by the dead owner."
1112 msgstr ""
1113 "Si un futex a un RT-mutex associé dans le noyau (c'est-à-dire qu'il y a des "
1114 "éléments en attente bloqués) et si le propriétaire du futex/RT-mutex meurt "
1115 "de manière inattendue, le noyau nettoie le RT-mutex et passe la main au "
1116 "prochain élément en attente. Cela implique, en retour, que la valeur dans "
1117 "l'espace utilisateur soit mise à jour en fonction. Pour dire que c'est "
1118 "nécessaire, le noyau positionne le bit B<FUTEX_OWNER_DIED> dans le mot futex "
1119 "ainsi que dans l'ID du thread du nouveau propriétaire. L'espace utilisateur "
1120 "peut détecter cette situation par la présence du bit B<FUTEX_OWNER_DIED> et "
1121 "il est alors responsable pour nettoyer l'espace laissé par le propriétaire "
1122 "mort."
1123
1124 #. type: Plain text
1125 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1126 #: opensuse-tumbleweed
1127 #, fuzzy
1128 #| msgid ""
1129 #| "PI futexes are operated on by specifying one of the values listed below "
1130 #| "in I<futex_op>. Note that the PI futex operations must be used as paired "
1131 #| "operations and are subject to some additional requirements:"
1132 msgid ""
1133 "PI futexes are operated on by specifying one of the values listed below in "
1134 "I<op>. Note that the PI futex operations must be used as paired operations "
1135 "and are subject to some additional requirements:"
1136 msgstr ""
1137 "Les PI futex sont utilisés en indiquant une des valeurs listées ci-dessous "
1138 "dans I<futex_op>. Remarquez que les opérations de PI futex doivent être "
1139 "utilisées par paires et sont soumises à des exigences supplémentaires :"
1140
1141 #. type: Plain text
1142 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1143 #: opensuse-tumbleweed
1144 #, fuzzy
1145 #| msgid ""
1146 #| "B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, and B<FUTEX_TRYLOCK_PI> pair with "
1147 #| "B<FUTEX_UNLOCK_PI>. B<FUTEX_UNLOCK_PI> must be called only on a futex "
1148 #| "owned by the calling thread, as defined by the value policy, otherwise "
1149 #| "the error B<EPERM> results."
1150 msgid ""
1151 "B<FUTEX_LOCK_PI>(2const), B<FUTEX_LOCK_PI2>(2const), and "
1152 "B<FUTEX_TRYLOCK_PI>(2const) pair with B<FUTEX_UNLOCK_PI>(2const). "
1153 "B<FUTEX_UNLOCK_PI>(2const) must be called only on a futex owned by the "
1154 "calling thread, as defined by the value policy, otherwise the error B<EPERM> "
1155 "results."
1156 msgstr ""
1157 "B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2> et B<FUTEX_TRYLOCK_PI> vont de pair avec "
1158 "B<FUTEX_UNLOCK_PI>. B<FUTEX_UNLOCK_PI> ne doit être appelé que sur un futex "
1159 "appartenant au thread appelant, tel que défini par les règles de la valeur, "
1160 "sans quoi on obtient l'erreur B<EPERM>."
1161
1162 #. type: Plain text
1163 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1164 #: opensuse-tumbleweed
1165 #, fuzzy
1166 #| msgid ""
1167 #| "B<FUTEX_WAIT_REQUEUE_PI> pairs with B<FUTEX_CMP_REQUEUE_PI>. This must "
1168 #| "be performed from a non-PI futex to a distinct PI futex (or the error "
1169 #| "B<EINVAL> results). Additionally, I<val> (the number of waiters to be "
1170 #| "woken) must be 1 (or the error B<EINVAL> results)."
1171 msgid ""
1172 "B<FUTEX_WAIT_REQUEUE_PI>(2const) pairs with "
1173 "B<FUTEX_CMP_REQUEUE_PI>(2const). This must be performed from a non-PI futex "
1174 "to a distinct PI futex (or the error B<EINVAL> results). Additionally, the "
1175 "number of waiters to be woken must be 1 (or the error B<EINVAL> results)."
1176 msgstr ""
1177 "B<FUTEX_WAIT_REQUEUE_PI> va de pair avec B<FUTEX_CMP_REQUEUE_PI>. Elles "
1178 "doivent s'effectuer depuis un futex non-PI vers un PI futex distinct (sans "
1179 "quoi on obtient l'erreur B<EINVAL>). De plus, I<val> (le nombre d'éléments "
1180 "en attente à réveiller) doit être de B<1> (sans quoi on obtient l'erreur "
1181 "B<EINVAL>)."
1182
1183 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1184 #. type: Plain text
1185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1187 msgid "The PI futex operations are as follows:"
1188 msgstr "Les opérations PI futex sont comme suit :"
1189
1190 #. type: TP
1191 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1192 #: opensuse-tumbleweed
1193 #, fuzzy, no-wrap
1194 #| msgid "B<FUTEX_LOCK_PI>"
1195 msgid "B<FUTEX_LOCK_PI>(2const)"
1196 msgstr "B<FUTEX_LOCK_PI>"
1197
1198 #. type: TQ
1199 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1200 #: opensuse-tumbleweed
1201 #, fuzzy, no-wrap
1202 #| msgid "B<FUTEX_LOCK_PI2>"
1203 msgid "B<FUTEX_LOCK_PI2>(2const)"
1204 msgstr "B<FUTEX_LOCK_PI2>"
1205
1206 #. type: TQ
1207 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1208 #: opensuse-tumbleweed
1209 #, fuzzy, no-wrap
1210 #| msgid "B<FUTEX_TRYLOCK_PI>"
1211 msgid "B<FUTEX_TRYLOCK_PI>(2const)"
1212 msgstr "B<FUTEX_TRYLOCK_PI>"
1213
1214 #. type: TQ
1215 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1216 #: opensuse-tumbleweed
1217 #, fuzzy, no-wrap
1218 #| msgid "B<FUTEX_UNLOCK_PI>"
1219 msgid "B<FUTEX_UNLOCK_PI>(2const)"
1220 msgstr "B<FUTEX_UNLOCK_PI>"
1221
1222 #. type: TQ
1223 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1224 #: opensuse-tumbleweed
1225 #, fuzzy, no-wrap
1226 #| msgid "B<FUTEX_CMP_REQUEUE_PI>"
1227 msgid "B<FUTEX_CMP_REQUEUE_PI>(2const)"
1228 msgstr "B<FUTEX_CMP_REQUEUE_PI>"
1229
1230 #. type: TQ
1231 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1232 #: opensuse-tumbleweed
1233 #, fuzzy, no-wrap
1234 #| msgid "B<FUTEX_WAIT_REQUEUE_PI>"
1235 msgid "B<FUTEX_WAIT_REQUEUE_PI>(2const)"
1236 msgstr "B<FUTEX_WAIT_REQUEUE_PI>"
1237
1238 #
1239 #
1240 #
1241 #
1242 #
1243 #. Darren Hart notes that a patch to allow glibc to fully support
1244 #. PI-aware pthreads condition variables has not yet been accepted into
1245 #. glibc. The story is complex, and can be found at
1246 #. https://sourceware.org/bugzilla/show_bug.cgi?id=11588
1247 #. Darren notes that in the meantime, the patch is shipped with various
1248 #. PREEMPT_RT-enabled Linux systems.
1249 #. Related to the preceding, Darren proposed that somewhere, man-pages
1250 #. should document the following point:
1251 #. While the Linux kernel, since Linux 2.6.31, supports requeueing of
1252 #. priority-inheritance (PI) aware mutexes via the
1253 #. FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI futex operations,
1254 #. the glibc implementation does not yet take full advantage of this.
1255 #. Specifically, the condvar internal data lock remains a non-PI aware
1256 #. mutex, regardless of the type of the pthread_mutex associated with
1257 #. the condvar. This can lead to an unbounded priority inversion on
1258 #. the internal data lock even when associating a PI aware
1259 #. pthread_mutex with a condvar during a pthread_cond*_wait
1260 #. operation. For this reason, it is not recommended to rely on
1261 #. priority inheritance when using pthread condition variables.
1262 #. The problem is that the obvious location for this text is
1263 #. the pthread_cond*wait(3) man page. However, such a man page
1264 #. does not currently exist.
1265 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1266 #. type: Plain text
1267 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1268 #: opensuse-tumbleweed
1269 #, fuzzy
1270 #| msgid ""
1271 #| "The B<FUTEX_WAIT_REQUEUE_PI> and B<FUTEX_CMP_REQUEUE_PI> were added to "
1272 #| "support a fairly specific use case: support for priority-inheritance-"
1273 #| "aware POSIX threads condition variables. The idea is that these "
1274 #| "operations should always be paired, in order to ensure that user space "
1275 #| "and the kernel remain in sync. Thus, in the B<FUTEX_WAIT_REQUEUE_PI> "
1276 #| "operation, the user-space application pre-specifies the target of the "
1277 #| "requeue that takes place in the B<FUTEX_CMP_REQUEUE_PI> operation."
1278 msgid ""
1279 "The B<FUTEX_WAIT_REQUEUE_PI>(2const) and B<FUTEX_CMP_REQUEUE_PI>(2const) "
1280 "were added to support a fairly specific use case: support for priority-"
1281 "inheritance-aware POSIX threads condition variables. The idea is that these "
1282 "operations should always be paired, in order to ensure that user space and "
1283 "the kernel remain in sync. Thus, in the B<FUTEX_WAIT_REQUEUE_PI>(2const) "
1284 "operation, the user-space application pre-specifies the target of the "
1285 "requeue that takes place in the B<FUTEX_CMP_REQUEUE_PI>(2const) operation."
1286 msgstr ""
1287 "B<FUTEX_WAIT_REQUEUE_PI> et B<FUTEX_CMP_REQUEUE_PI> ont été ajoutés pour "
1288 "gérer un cas d'utilisation bien particulier : la prise en charge des "
1289 "variables conditionnelles de threads POSIX ayant connaissance de l'héritage "
1290 "de priorité. L'idée est que ces opérations devraient toujours aller par "
1291 "paires, afin de garantir que l'espace utilisateur et le noyau restent "
1292 "toujours synchronisés. Ainsi, dans l'opération B<FUTEX_WAIT_REQUEUE_PI>, "
1293 "l'application dans l'espace utilisateur pré-indique la cible de la remise en "
1294 "attente qui va se faire dans l'opération B<FUTEX_CMP_REQUEUE_PI>."
1295
1296 #. type: SH
1297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1299 #, no-wrap
1300 msgid "RETURN VALUE"
1301 msgstr "VALEUR RENVOYÉE"
1302
1303 #. type: Plain text
1304 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1305 #: opensuse-tumbleweed
1306 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
1307 msgstr ""
1308 "En cas d'erreur, la valeur de retour est B<-1> et I<errno> est définie pour "
1309 "préciser l'erreur."
1310
1311 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1312 #. type: Plain text
1313 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1314 #: opensuse-tumbleweed
1315 #, fuzzy
1316 #| msgid ""
1317 #| "The return value on success depends on the operation, as described in the "
1318 #| "following list:"
1319 msgid "The return value on success depends on the operation."
1320 msgstr ""
1321 "En cas de succès, le code de retour dépend de l'opération, comme décrit dans "
1322 "la liste suivante :"
1323
1324 #. type: SH
1325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1327 #, no-wrap
1328 msgid "ERRORS"
1329 msgstr "ERREURS"
1330
1331 #. type: TP
1332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1334 #, no-wrap
1335 msgid "B<EACCES>"
1336 msgstr "B<EACCES>"
1337
1338 #. type: Plain text
1339 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1340 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1341 msgid "No read access to the memory of a futex word."
1342 msgstr "Pas d'accès en lecture à la mémoire d'un mot futex."
1343
1344 #. type: TP
1345 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1346 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1347 #, no-wrap
1348 msgid "B<EFAULT>"
1349 msgstr "B<EFAULT>"
1350
1351 #. type: Plain text
1352 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1353 #: opensuse-tumbleweed
1354 #, fuzzy
1355 #| msgid ""
1356 #| "A required pointer argument (i.e., I<uaddr>, I<uaddr2>, or I<timeout>) "
1357 #| "did not point to a valid user-space address."
1358 msgid "I<uaddr> did not point to a valid user-space address."
1359 msgstr ""
1360 "Le paramètre d'un pointeur nécessaire (c'est-à-dire I<uaddr>, I<uaddr2> ou "
1361 "I<timeout>) ne pointait pas vers une adresse valable de l'espace utilisateur."
1362
1363 #. type: TP
1364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1366 #, no-wrap
1367 msgid "B<EINVAL>"
1368 msgstr "B<EINVAL>"
1369
1370 #. type: Plain text
1371 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1372 #: opensuse-tumbleweed
1373 #, fuzzy
1374 #| msgid ""
1375 #| "The operation specified in I<futex_op> employs one or both of the "
1376 #| "pointers I<uaddr> and I<uaddr2>, but one of these does not point to a "
1377 #| "valid object\\[em]that is, the address is not four-byte-aligned."
1378 msgid ""
1379 "I<uaddr> does not point to a valid object\\[em]that is, the address is not "
1380 "four-byte-aligned."
1381 msgstr ""
1382 "L'opération indiquée dans I<futex_op> utilise I<uaddr> et/ou I<uaddr2> mais "
1383 "l'un d'eux ne pointe pas vers un objet valable — c'est-à-dire, l'adresse "
1384 "n'est pas alignée sur quatre octets."
1385
1386 #. type: Plain text
1387 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1388 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1389 msgid "Invalid argument."
1390 msgstr "Argument incorrect."
1391
1392 #. type: TP
1393 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1394 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1395 #, no-wrap
1396 msgid "B<ENOSYS>"
1397 msgstr "B<ENOSYS>"
1398
1399 #. type: Plain text
1400 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1401 #: opensuse-tumbleweed
1402 #, fuzzy
1403 #| msgid "Invalid operation specified in I<futex_op>."
1404 msgid "Invalid operation specified in I<op>."
1405 msgstr "Opération non valable indiquée dans I<futex_op>."
1406
1407 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1408 #. type: Plain text
1409 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1410 #: opensuse-tumbleweed
1411 #, fuzzy
1412 #| msgid ""
1413 #| "The B<FUTEX_CLOCK_REALTIME> option was specified in I<futex_op>, but the "
1414 #| "accompanying operation was neither B<FUTEX_WAIT>, B<FUTEX_WAIT_BITSET>, "
1415 #| "B<FUTEX_WAIT_REQUEUE_PI>, nor B<FUTEX_LOCK_PI2>."
1416 msgid ""
1417 "The B<FUTEX_CLOCK_REALTIME> option was specified in I<op>, but the "
1418 "accompanying operation was neither B<FUTEX_WAIT_BITSET>(2const), "
1419 "B<FUTEX_WAIT_REQUEUE_PI>(2const), nor B<FUTEX_LOCK_PI2>(2const)."
1420 msgstr ""
1421 "L'option B<FUTEX_CLOCK_REALTIME> était indiquée dans I<futex_op>, mais "
1422 "l'opération qui l'accompagne n'est ni B<FUTEX_WAIT>, ni "
1423 "B<FUTEX_WAIT_BITSET>, ni B<FUTEX_WAIT_REQUEUE_PI>, ni B<FUTEX_LOCK_PI2>."
1424
1425 #. type: SH
1426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1428 #, no-wrap
1429 msgid "STANDARDS"
1430 msgstr "NORMES"
1431
1432 #. type: Plain text
1433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1435 msgid "Linux."
1436 msgstr "Linux."
1437
1438 #. type: SH
1439 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1440 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1441 #, no-wrap
1442 msgid "HISTORY"
1443 msgstr "HISTORIQUE"
1444
1445 #. type: Plain text
1446 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1447 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1448 msgid "Linux 2.6.0."
1449 msgstr "Linux 2.6.0."
1450
1451 #. type: Plain text
1452 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1453 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1454 msgid ""
1455 "Initial futex support was merged in Linux 2.5.7 but with different semantics "
1456 "from what was described above. A four-argument system call with the "
1457 "semantics described in this page was introduced in Linux 2.5.40. A fifth "
1458 "argument was added in Linux 2.5.70, and a sixth argument was added in Linux "
1459 "2.6.7."
1460 msgstr ""
1461 "La prise en charge initiale des futex a été ajoutée dans Linux 2.5.7 mais "
1462 "avec une sémantique différente de celle décrite ci\\(hydessus. Un appel "
1463 "système à 4 paramètres avec la sémantique décrite dans cette page a été "
1464 "ajouté dans Linux 2.5.40. Dans Linux 2.5.70, un cinquième paramètre a été "
1465 "ajouté. Un sixième paramètre a été ajouté dans Linux 2.6.7."
1466
1467 #. type: SH
1468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1470 #, no-wrap
1471 msgid "EXAMPLES"
1472 msgstr "EXEMPLES"
1473
1474 #. type: Plain text
1475 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1476 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1477 msgid ""
1478 "The program below demonstrates use of futexes in a program where a parent "
1479 "process and a child process use a pair of futexes located inside a shared "
1480 "anonymous mapping to synchronize access to a shared resource: the terminal. "
1481 "The two processes each write I<nloops> (a command-line argument that "
1482 "defaults to 5 if omitted) messages to the terminal and employ a "
1483 "synchronization protocol that ensures that they alternate in writing "
1484 "messages. Upon running this program we see output such as the following:"
1485 msgstr ""
1486 "Le programme ci-dessous montre l'utilisation des futex dans un programme où "
1487 "un processus parent et un processus enfant utilisent une paire de futex "
1488 "située dans un tableau anonyme partagé pour synchroniser l'accès à une "
1489 "ressource partagée : le terminal. Les deux processus écrivent chacun un "
1490 "message I<nloops> (un paramètre en ligne de commande qui vaut 5 par défaut "
1491 "s'il est absent) sur le terminal et ils utilisent un protocole de "
1492 "synchronisation pour garantir qu'ils alternent dans l'écriture des messages. "
1493 "Pendant l'exécution de ce programme, nous voyons un affichage comme suit :"
1494
1495 #. type: Plain text
1496 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1497 #: opensuse-tumbleweed
1498 #, fuzzy, no-wrap
1499 #| msgid ""
1500 #| "$ B<./futex_demo>\n"
1501 #| "Parent (18534) 0\n"
1502 #| "Child (18535) 0\n"
1503 #| "Parent (18534) 1\n"
1504 #| "Child (18535) 1\n"
1505 #| "Parent (18534) 2\n"
1506 #| "Child (18535) 2\n"
1507 #| "Parent (18534) 3\n"
1508 #| "Child (18535) 3\n"
1509 #| "Parent (18534) 4\n"
1510 #| "Child (18535) 4\n"
1511 msgid ""
1512 "$B< ./futex_demo>;\n"
1513 "Parent (18534) 0\n"
1514 "Child (18535) 0\n"
1515 "Parent (18534) 1\n"
1516 "Child (18535) 1\n"
1517 "Parent (18534) 2\n"
1518 "Child (18535) 2\n"
1519 "Parent (18534) 3\n"
1520 "Child (18535) 3\n"
1521 "Parent (18534) 4\n"
1522 "Child (18535) 4\n"
1523 msgstr ""
1524 "$ B<./futex_demo>\n"
1525 "Parent (18534) 0\n"
1526 "Child (18535) 0\n"
1527 "Parent (18534) 1\n"
1528 "Child (18535) 1\n"
1529 "Parent (18534) 2\n"
1530 "Child (18535) 2\n"
1531 "Parent (18534) 3\n"
1532 "Child (18535) 3\n"
1533 "Parent (18534) 4\n"
1534 "Child (18535) 4\n"
1535
1536 #. type: SS
1537 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1538 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1539 #, no-wrap
1540 msgid "Program source"
1541 msgstr "Source du programme"
1542
1543 #. type: Plain text
1544 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
1545 #, fuzzy, no-wrap
1546 #| msgid ""
1547 #| "/* futex_demo.c\n"
1548 #| "\\&\n"
1549 #| " Usage: futex_demo [nloops]\n"
1550 #| " (Default: 5)\n"
1551 #| "\\&\n"
1552 #| " Demonstrate the use of futexes in a program where parent and child\n"
1553 #| " use a pair of futexes located inside a shared anonymous mapping to\n"
1554 #| " synchronize access to a shared resource: the terminal. The two\n"
1555 #| " processes each write \\[aq]num-loops\\[aq] messages to the terminal and employ\n"
1556 #| " a synchronization protocol that ensures that they alternate in\n"
1557 #| " writing messages.\n"
1558 #| "*/\n"
1559 #| "#define _GNU_SOURCE\n"
1560 #| "#include E<lt>err.hE<gt>\n"
1561 #| "#include E<lt>errno.hE<gt>\n"
1562 #| "#include E<lt>linux/futex.hE<gt>\n"
1563 #| "#include E<lt>stdatomic.hE<gt>\n"
1564 #| "#include E<lt>stdint.hE<gt>\n"
1565 #| "#include E<lt>stdio.hE<gt>\n"
1566 #| "#include E<lt>stdlib.hE<gt>\n"
1567 #| "#include E<lt>sys/mman.hE<gt>\n"
1568 #| "#include E<lt>sys/syscall.hE<gt>\n"
1569 #| "#include E<lt>sys/time.hE<gt>\n"
1570 #| "#include E<lt>sys/wait.hE<gt>\n"
1571 #| "#include E<lt>unistd.hE<gt>\n"
1572 #| "\\&\n"
1573 #| "static uint32_t *futex1, *futex2, *iaddr;\n"
1574 #| "\\&\n"
1575 #| "static int\n"
1576 #| "futex(uint32_t *uaddr, int futex_op, uint32_t val,\n"
1577 #| " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
1578 #| "{\n"
1579 #| " return syscall(SYS_futex, uaddr, futex_op, val,\n"
1580 #| " timeout, uaddr2, val3);\n"
1581 #| "}\n"
1582 #| "\\&\n"
1583 #| "/* Acquire the futex pointed to by \\[aq]futexp\\[aq]: wait for its value to\n"
1584 #| " become 1, and then set the value to 0. */\n"
1585 #| "\\&\n"
1586 #| "static void\n"
1587 #| "fwait(uint32_t *futexp)\n"
1588 #| "{\n"
1589 #| " long s;\n"
1590 #| " const uint32_t one = 1;\n"
1591 #| "\\&\n"
1592 #| " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
1593 #| " atomically performs the equivalent of:\n"
1594 #| "\\&\n"
1595 #| " if (*ptr == *oldval)\n"
1596 #| " *ptr = newval;\n"
1597 #| "\\&\n"
1598 #| " It returns true if the test yielded true and *ptr was updated. */\n"
1599 #| "\\&\n"
1600 #| " while (1) {\n"
1601 #| "\\&\n"
1602 #| " /* Is the futex available? */\n"
1603 #| " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
1604 #| " break; /* Yes */\n"
1605 #| "\\&\n"
1606 #| " /* Futex is not available; wait. */\n"
1607 #| "\\&\n"
1608 #| " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
1609 #| " if (s == -1 && errno != EAGAIN)\n"
1610 #| " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
1611 #| " }\n"
1612 #| "}\n"
1613 #| "\\&\n"
1614 #| "/* Release the futex pointed to by \\[aq]futexp\\[aq]: if the futex currently\n"
1615 #| " has the value 0, set its value to 1 and then wake any futex waiters,\n"
1616 #| " so that if the peer is blocked in fwait(), it can proceed. */\n"
1617 #| "\\&\n"
1618 #| "static void\n"
1619 #| "fpost(uint32_t *futexp)\n"
1620 #| "{\n"
1621 #| " long s;\n"
1622 #| " const uint32_t zero = 0;\n"
1623 #| "\\&\n"
1624 #| " /* atomic_compare_exchange_strong() was described\n"
1625 #| " in comments above. */\n"
1626 #| "\\&\n"
1627 #| " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
1628 #| " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
1629 #| " if (s == -1)\n"
1630 #| " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
1631 #| " }\n"
1632 #| "}\n"
1633 #| "\\&\n"
1634 #| "int\n"
1635 #| "main(int argc, char *argv[])\n"
1636 #| "{\n"
1637 #| " pid_t childPid;\n"
1638 #| " unsigned int nloops;\n"
1639 #| "\\&\n"
1640 #| " setbuf(stdout, NULL);\n"
1641 #| "\\&\n"
1642 #| " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
1643 #| "\\&\n"
1644 #| " /* Create a shared anonymous mapping that will hold the futexes.\n"
1645 #| " Since the futexes are being shared between processes, we\n"
1646 #| " subsequently use the \"shared\" futex operations (i.e., not the\n"
1647 #| " ones suffixed \"_PRIVATE\"). */\n"
1648 #| "\\&\n"
1649 #| " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
1650 #| " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
1651 #| " if (iaddr == MAP_FAILED)\n"
1652 #| " err(EXIT_FAILURE, \"mmap\");\n"
1653 #| "\\&\n"
1654 #| " futex1 = &iaddr[0];\n"
1655 #| " futex2 = &iaddr[1];\n"
1656 #| "\\&\n"
1657 #| " *futex1 = 0; /* State: unavailable */\n"
1658 #| " *futex2 = 1; /* State: available */\n"
1659 #| "\\&\n"
1660 #| " /* Create a child process that inherits the shared anonymous\n"
1661 #| " mapping. */\n"
1662 #| "\\&\n"
1663 #| " childPid = fork();\n"
1664 #| " if (childPid == -1)\n"
1665 #| " err(EXIT_FAILURE, \"fork\");\n"
1666 #| "\\&\n"
1667 #| " if (childPid == 0) { /* Child */\n"
1668 #| " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
1669 #| " fwait(futex1);\n"
1670 #| " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
1671 #| " fpost(futex2);\n"
1672 #| " }\n"
1673 #| "\\&\n"
1674 #| " exit(EXIT_SUCCESS);\n"
1675 #| " }\n"
1676 #| "\\&\n"
1677 #| " /* Parent falls through to here. */\n"
1678 #| "\\&\n"
1679 #| " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
1680 #| " fwait(futex2);\n"
1681 #| " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
1682 #| " fpost(futex1);\n"
1683 #| " }\n"
1684 #| "\\&\n"
1685 #| " wait(NULL);\n"
1686 #| "\\&\n"
1687 #| " exit(EXIT_SUCCESS);\n"
1688 #| "}\n"
1689 msgid ""
1690 "/* futex_demo.c\n"
1691 "\\&\n"
1692 " Usage: futex_demo [nloops]\n"
1693 " (Default: 5)\n"
1694 "\\&\n"
1695 " Demonstrate the use of futexes in a program where parent and child\n"
1696 " use a pair of futexes located inside a shared anonymous mapping to\n"
1697 " synchronize access to a shared resource: the terminal. The two\n"
1698 " processes each write \\[aq]num-loops\\[aq] messages to the terminal and employ\n"
1699 " a synchronization protocol that ensures that they alternate in\n"
1700 " writing messages.\n"
1701 "*/\n"
1702 "#define _GNU_SOURCE\n"
1703 "#include E<lt>err.hE<gt>\n"
1704 "#include E<lt>errno.hE<gt>\n"
1705 "#include E<lt>linux/futex.hE<gt>\n"
1706 "#include E<lt>stdatomic.hE<gt>\n"
1707 "#include E<lt>stdint.hE<gt>\n"
1708 "#include E<lt>stdio.hE<gt>\n"
1709 "#include E<lt>stdlib.hE<gt>\n"
1710 "#include E<lt>sys/mman.hE<gt>\n"
1711 "#include E<lt>sys/syscall.hE<gt>\n"
1712 "#include E<lt>sys/time.hE<gt>\n"
1713 "#include E<lt>sys/wait.hE<gt>\n"
1714 "#include E<lt>unistd.hE<gt>\n"
1715 "\\&\n"
1716 "static uint32_t *futex1, *futex2, *iaddr;\n"
1717 "\\&\n"
1718 "static int\n"
1719 "futex(uint32_t *uaddr, int op, uint32_t val,\n"
1720 " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
1721 "{\n"
1722 " return syscall(SYS_futex, uaddr, op, val,\n"
1723 " timeout, uaddr2, val3);\n"
1724 "}\n"
1725 "\\&\n"
1726 "/* Acquire the futex pointed to by \\[aq]futexp\\[aq]: wait for its value to\n"
1727 " become 1, and then set the value to 0. */\n"
1728 "\\&\n"
1729 "static void\n"
1730 "fwait(uint32_t *futexp)\n"
1731 "{\n"
1732 " long s;\n"
1733 " const uint32_t one = 1;\n"
1734 "\\&\n"
1735 " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
1736 " atomically performs the equivalent of:\n"
1737 "\\&\n"
1738 " if (*ptr == *oldval)\n"
1739 " *ptr = newval;\n"
1740 "\\&\n"
1741 " It returns true if the test yielded true and *ptr was updated. */\n"
1742 "\\&\n"
1743 " for (;;) {\n"
1744 "\\&\n"
1745 " /* Is the futex available? */\n"
1746 " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
1747 " break; /* Yes */\n"
1748 "\\&\n"
1749 " /* Futex is not available; wait. */\n"
1750 "\\&\n"
1751 " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
1752 " if (s == -1 && errno != EAGAIN)\n"
1753 " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
1754 " }\n"
1755 "}\n"
1756 "\\&\n"
1757 "/* Release the futex pointed to by \\[aq]futexp\\[aq]: if the futex currently\n"
1758 " has the value 0, set its value to 1 and then wake any futex waiters,\n"
1759 " so that if the peer is blocked in fwait(), it can proceed. */\n"
1760 "\\&\n"
1761 "static void\n"
1762 "fpost(uint32_t *futexp)\n"
1763 "{\n"
1764 " long s;\n"
1765 " const uint32_t zero = 0;\n"
1766 "\\&\n"
1767 " /* atomic_compare_exchange_strong() was described\n"
1768 " in comments above. */\n"
1769 "\\&\n"
1770 " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
1771 " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
1772 " if (s == -1)\n"
1773 " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
1774 " }\n"
1775 "}\n"
1776 "\\&\n"
1777 "int\n"
1778 "main(int argc, char *argv[])\n"
1779 "{\n"
1780 " pid_t childPid;\n"
1781 " unsigned int nloops;\n"
1782 "\\&\n"
1783 " setbuf(stdout, NULL);\n"
1784 "\\&\n"
1785 " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
1786 "\\&\n"
1787 " /* Create a shared anonymous mapping that will hold the futexes.\n"
1788 " Since the futexes are being shared between processes, we\n"
1789 " subsequently use the \"shared\" futex operations (i.e., not the\n"
1790 " ones suffixed \"_PRIVATE\"). */\n"
1791 "\\&\n"
1792 " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
1793 " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
1794 " if (iaddr == MAP_FAILED)\n"
1795 " err(EXIT_FAILURE, \"mmap\");\n"
1796 "\\&\n"
1797 " futex1 = &iaddr[0];\n"
1798 " futex2 = &iaddr[1];\n"
1799 "\\&\n"
1800 " *futex1 = 0; /* State: unavailable */\n"
1801 " *futex2 = 1; /* State: available */\n"
1802 "\\&\n"
1803 " /* Create a child process that inherits the shared anonymous\n"
1804 " mapping. */\n"
1805 "\\&\n"
1806 " childPid = fork();\n"
1807 " if (childPid == -1)\n"
1808 " err(EXIT_FAILURE, \"fork\");\n"
1809 "\\&\n"
1810 " if (childPid == 0) { /* Child */\n"
1811 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
1812 " fwait(futex1);\n"
1813 " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
1814 " fpost(futex2);\n"
1815 " }\n"
1816 "\\&\n"
1817 " exit(EXIT_SUCCESS);\n"
1818 " }\n"
1819 "\\&\n"
1820 " /* Parent falls through to here. */\n"
1821 "\\&\n"
1822 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
1823 " fwait(futex2);\n"
1824 " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
1825 " fpost(futex1);\n"
1826 " }\n"
1827 "\\&\n"
1828 " wait(NULL);\n"
1829 "\\&\n"
1830 " exit(EXIT_SUCCESS);\n"
1831 "}\n"
1832 msgstr ""
1833 "/* futex_demo.c\n"
1834 "\\&\n"
1835 " Usage: futex_demo [nloops]\n"
1836 " (Default: 5)\n"
1837 "\\&\n"
1838 " Montrer l'utilisation des futex dans un programme où le parent et\n"
1839 " l'enfant utilisent une paire de futex située dans un tableau anonyme\n"
1840 " partagé pour synchroniser l'accès à une ressource partagée : le\n"
1841 " terminal. Les processus écrivent chacun des messages \\[aq]num-loops\\[aq]\n"
1842 " sur le terminal et ils utilisent un protocole de synchronisation qui\n"
1843 " garantit qu'ils alternent l'écriture des messages.\n"
1844 "*/\n"
1845 "#define _GNU_SOURCE\n"
1846 "#include E<lt>err.hE<gt>\n"
1847 "#include E<lt>errno.hE<gt>\n"
1848 "#include E<lt>linux/futex.hE<gt>\n"
1849 "#include E<lt>stdatomic.hE<gt>\n"
1850 "#include E<lt>stdint.hE<gt>\n"
1851 "#include E<lt>stdio.hE<gt>\n"
1852 "#include E<lt>stdlib.hE<gt>\n"
1853 "#include E<lt>sys/mman.hE<gt>\n"
1854 "#include E<lt>sys/syscall.hE<gt>\n"
1855 "#include E<lt>sys/time.hE<gt>\n"
1856 "#include E<lt>sys/wait.hE<gt>\n"
1857 "#include E<lt>unistd.hE<gt>\n"
1858 "\\&\n"
1859 "static uint32_t *futex1, *futex2, *iaddr;\n"
1860 "\\&\n"
1861 "static int\n"
1862 "futex(uint32_t *uaddr, int futex_op, uint32_t val,\n"
1863 " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
1864 "{\n"
1865 " return syscall(SYS_futex, uaddr, futex_op, val,\n"
1866 " timeout, uaddr2, val3);\n"
1867 "}\n"
1868 "\\&\n"
1869 "/* Acquérir le futex vers lequel pointe \\[aq]futexp\\[aq] : attendre que sa\n"
1870 " valeur passe à 1 puis positionner la valeur sur 0. */\n"
1871 "\\&\n"
1872 "static void\n"
1873 "fwait(uint32_t *futexp)\n"
1874 "{\n"
1875 " long s;\n"
1876 " const uint32_t one = 1;\n"
1877 "\\&\n"
1878 " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
1879 " fait atomiquement comme :\n"
1880 "\\&\n"
1881 " if (*ptr == *oldval)\n"
1882 " *ptr = newval;\n"
1883 "\\&\n"
1884 " Il renvoie true si le test a montré true et *ptr a été mis à jour. */\n"
1885 "\\&\n"
1886 " while (1) {\n"
1887 "\\&\n"
1888 " /* Le futex est-il disponible ? */\n"
1889 " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
1890 " break; /* Oui */\n"
1891 "\\&\n"
1892 " /* Le futex n'est pas disponible ; attendre. */\n"
1893 "\\&\n"
1894 " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
1895 " if (s == -1 && errno != EAGAIN)\n"
1896 " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
1897 " }\n"
1898 "}\n"
1899 "\\&\n"
1900 "/* Relâcher le futex vers lequel pointe \\[aq]futexp\\[aq] : si le futex a\n"
1901 " actuellement la valeur 0, positionner la valeur à 1 et réveiller tous les\n"
1902 " futex en attente pour que si le pair est bloqué dans fwait(), ça puisse\n"
1903 " continuer. */\n"
1904 "\\&\n"
1905 "static void\n"
1906 "fpost(uint32_t *futexp)\n"
1907 "{\n"
1908 " long s;\n"
1909 " const uint32_t zero = 0;\n"
1910 "\\&\n"
1911 " /* atomic_compare_exchange_strong() a été décrit\n"
1912 " dans les commentaires ci-dessus. */\n"
1913 "\\&\n"
1914 " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
1915 " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
1916 " if (s == -1)\n"
1917 " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
1918 " }\n"
1919 "}\n"
1920 "\\&\n"
1921 "int\n"
1922 "main(int argc, char *argv[])\n"
1923 "{\n"
1924 " pid_t childPid;\n"
1925 " unsigned int nloops;\n"
1926 "\\&\n"
1927 " setbuf(stdout, NULL);\n"
1928 "\\&\n"
1929 " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
1930 "\\&\n"
1931 " /* Créer un tableau anonyme partagé qui gardera les futex.\n"
1932 " Comme les futex vont être partagés entre les processus, nous\n"
1933 " utilisons donc les opérations futex « shared » (donc pas celles\n"
1934 " dont le suffixe est \"_PRIVATE\") */\n"
1935 "\\&\n"
1936 " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
1937 " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
1938 " if (iaddr == MAP_FAILED)\n"
1939 " err(EXIT_FAILURE, \"mmap\");\n"
1940 "\\&\n"
1941 " futex1 = &iaddr[0];\n"
1942 " futex2 = &iaddr[1];\n"
1943 "\\&\n"
1944 " *futex1 = 0; /* State: unavailable */\n"
1945 " *futex2 = 1; /* State: available */\n"
1946 "\\&\n"
1947 " /* Créer un processus enfant qui hérite du tableau anonyme\n"
1948 " partagé. */\n"
1949 "\\&\n"
1950 " childPid = fork();\n"
1951 " if (childPid == -1)\n"
1952 " err(EXIT_FAILURE, \"fork\");\n"
1953 "\\&\n"
1954 " if (childPid == 0) { /* Child */\n"
1955 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
1956 " fwait(futex1);\n"
1957 " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
1958 " fpost(futex2);\n"
1959 " }\n"
1960 "\\&\n"
1961 " exit(EXIT_SUCCESS);\n"
1962 " }\n"
1963 "\\&\n"
1964 " /* Le parent se retrouve ici. */\n"
1965 "\\&\n"
1966 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
1967 " fwait(futex2);\n"
1968 " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
1969 " fpost(futex1);\n"
1970 " }\n"
1971 "\\&\n"
1972 " wait(NULL);\n"
1973 "\\&\n"
1974 " exit(EXIT_SUCCESS);\n"
1975 "}\n"
1976
1977 #. SRC END
1978 #. type: SH
1979 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1980 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1981 #, no-wrap
1982 msgid "SEE ALSO"
1983 msgstr "VOIR AUSSI"
1984
1985 #. type: Plain text
1986 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1987 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1988 msgid ""
1989 "B<get_robust_list>(2), B<restart_syscall>(2), "
1990 "B<pthread_mutexattr_getprotocol>(3), B<futex>(7), B<sched>(7)"
1991 msgstr ""
1992 "B<get_robust_list>(2), B<restart_syscall>(2), "
1993 "B<pthread_mutexattr_getprotocol>(3), B<futex>(7), B<sched>(7)"
1994
1995 #. type: Plain text
1996 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1997 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1998 msgid "The following kernel source files:"
1999 msgstr "Les fichiers suivants des sources du noyau :"
2000
2001 #. type: Plain text
2002 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2003 #: opensuse-tumbleweed
2004 #, fuzzy
2005 #| msgid "I<Documentation/locking/rt-mutex.txt>"
2006 msgid "I<Documentation/locking/pi-futex.rst>"
2007 msgstr "I<Documentation/locking/rt-mutex.txt>"
2008
2009 #. type: Plain text
2010 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2011 #: opensuse-tumbleweed
2012 #, fuzzy
2013 #| msgid "I<Documentation/futex-requeue-pi.txt>"
2014 msgid "I<Documentation/locking/futex-requeue-pi.rst>"
2015 msgstr "I<Documentation/futex-requeue-pi.txt>"
2016
2017 #. type: Plain text
2018 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2019 #: opensuse-tumbleweed
2020 #, fuzzy
2021 #| msgid "I<Documentation/locking/rt-mutex.txt>"
2022 msgid "I<Documentation/locking/rt-mutex.rst>"
2023 msgstr "I<Documentation/locking/rt-mutex.txt>"
2024
2025 #. type: Plain text
2026 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2027 #: opensuse-tumbleweed
2028 #, fuzzy
2029 #| msgid "I<Documentation/locking/rt-mutex-design.txt>"
2030 msgid "I<Documentation/locking/rt-mutex-design.rst>"
2031 msgstr "I<Documentation/locking/rt-mutex-design.txt>"
2032
2033 #. type: Plain text
2034 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2035 #: opensuse-tumbleweed
2036 #, fuzzy
2037 #| msgid "I<Documentation/robust-futex-ABI.txt>"
2038 msgid "I<Documentation/robust-futex-ABI.rst>"
2039 msgstr "I<Documentation/robust-futex-ABI.txt>"
2040
2041 #. type: Plain text
2042 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2043 #: opensuse-tumbleweed
2044 msgid "Franke, H., Russell, R., and Kirwood, M., 2002."
2045 msgstr ""
2046
2047 #. type: Plain text
2048 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2049 #: opensuse-tumbleweed
2050 #, fuzzy
2051 #| msgid ""
2052 #| "Franke, H., Russell, R., and Kirwood, M., 2002. I<Fuss, Futexes and "
2053 #| "Furwocks: Fast Userlevel Locking in Linux> (from proceedings of the "
2054 #| "Ottawa Linux Symposium 2002),"
2055 msgid ""
2056 "E<.UR http:\\://kernel.org/\\:doc/\\:ols/\\:2002/\\:ols2002-"
2057 "pages-479-495.pdf> I<Fuss, Futexes and Furwocks: Fast Userlevel Locking in "
2058 "Linux> E<.UE> (from proceedings of the Ottawa Linux Symposium 2002)."
2059 msgstr ""
2060 "Franke, H., Russell, R., and Kirwood, M., 2002. I<Fuss, Futexes and "
2061 "Furwocks: Fast Userlevel Locking in Linux> (à partir des actions d'Ottawa "
2062 "Linux Symposium 2002),"
2063
2064 #. type: Plain text
2065 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2066 #: opensuse-tumbleweed
2067 #, fuzzy
2068 #| msgid ""
2069 #| "Hart, D., 2009. I<A futex overview and update>, E<.UR http://lwn.net/"
2070 #| "Articles/360699/> E<.UE>"
2071 msgid ""
2072 "Hart, D., 2009. E<.UR http:\\://lwn.net/\\:Articles/\\:360699/> I<A futex "
2073 "overview and update> E<.UE .>"
2074 msgstr ""
2075 "Hart, D., 2009. I<A futex overview and update>, E<.UR http://lwn.net/"
2076 "Articles/360699/> E<.UE>"
2077
2078 #. type: Plain text
2079 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2080 #: opensuse-tumbleweed
2081 #, fuzzy
2082 #| msgid ""
2083 #| "Hart, D.\\& and Guniguntala, D., 2009. I<Requeue-PI: Making glibc "
2084 #| "Condvars PI-Aware> (from proceedings of the 2009 Real-Time Linux "
2085 #| "Workshop), E<.UR http://lwn.net/images/conf/rtlws11/papers/proc/p10.pdf> "
2086 #| "E<.UE>"
2087 msgid ""
2088 "Hart, D.\\& and Guniguntala, D., 2009. E<.UR http:\\://lwn.net/\\:images/"
2089 "\\:conf/\\:rtlws11/\\:papers/\\:proc/\\:p10.pdf> I<Requeue-PI: Making glibc "
2090 "Condvars PI-Aware> E<.UE> (from proceedings of the 2009 Real-Time Linux "
2091 "Workshop)."
2092 msgstr ""
2093 "Hart, D. et Guniguntala, D., 2009. I<Requeue-PI: Making Glibc Condvars PI-"
2094 "Aware> (à partir des comptes rendus de l'atelier Real-Time Linux 2009), "
2095 "E<.UR http://lwn.net/images/conf/rtlws11/papers/proc/p10.pdf> E<.UE>"
2096
2097 #. type: Plain text
2098 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2099 #: opensuse-tumbleweed
2100 #, fuzzy
2101 #| msgid ""
2102 #| "Drepper, U., 2011. I<Futexes Are Tricky>, E<.UR http://www.akkadia.org/"
2103 #| "drepper/futex.pdf> E<.UE>"
2104 msgid ""
2105 "Drepper, U., 2011. E<.UR http:\\://www.akkadia.org/\\:drepper/\\:futex.pdf> "
2106 "I<Futexes Are Tricky> E<.UE .>"
2107 msgstr ""
2108 "Drepper, U., 2011. I<Futexes Are Tricky>, E<.UR http://www.akkadia.org/"
2109 "drepper/futex.pdf> E<.UE>"
2110
2111 #. type: Plain text
2112 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2113 #: opensuse-tumbleweed
2114 #, fuzzy
2115 #| msgid ""
2116 #| "E<.UR https://mirrors.kernel.org\\:/pub\\:/linux\\:/kernel\\:/people\\:/"
2117 #| "rusty/> E<.UE>"
2118 msgid ""
2119 "Futex example library, E<.UR https:\\://mirrors.kernel.org/\\:pub/\\:linux/"
2120 "\\:kernel/\\:people/\\:rusty/> futex-*.tar.bz2 E<.UE .>"
2121 msgstr ""
2122 "E<.UR https://mirrors.kernel.org\\:/pub\\:/linux\\:/kernel\\:/people\\:/"
2123 "rusty/> E<.UE>"
2124
2125 #. type: TH
2126 #: debian-trixie
2127 #, no-wrap
2128 msgid "2024-06-15"
2129 msgstr "15 juin 2024"
2130
2131 #. type: TH
2132 #: debian-trixie
2133 #, no-wrap
2134 msgid "Linux man-pages 6.9.1"
2135 msgstr "Pages du manuel de Linux 6.9.1"
2136
2137 #. type: Plain text
2138 #: debian-trixie
2139 msgid "Standard C library (I<libc>, I<-lc>)"
2140 msgstr "Bibliothèque C standard (I<libc>, I<-lc>)"
2141
2142 #. type: Plain text
2143 #: debian-trixie fedora-44 fedora-rawhide
2144 #, no-wrap
2145 msgid ""
2146 "B<#include E<lt>linux/futex.hE<gt>> /* Definition of B<FUTEX_*> constants */\n"
2147 "B<#include E<lt>sys/syscall.hE<gt>> /* Definition of B<SYS_*> constants */\n"
2148 "B<#include E<lt>unistd.hE<gt>>\n"
2149 msgstr ""
2150 "B<#include E<lt>linux/futex.hE<gt>> /* Définition des constantes B<FUTEX_*> */\n"
2151 "B<#include E<lt>sys/syscall.hE<gt>> /* Définition des constantes B<SYS_*> */\n"
2152 "B<#include E<lt>unistd.hE<gt>>\n"
2153
2154 #. type: Plain text
2155 #: debian-trixie fedora-44 fedora-rawhide
2156 #, no-wrap
2157 msgid ""
2158 "B<long syscall(SYS_futex, uint32_t *>I<uaddr>B<, int >I<futex_op>B<, uint32_t >I<val>B<,>\n"
2159 "B< const struct timespec *>I<timeout>B<,>I< > /* or: B<uint32_t >I<val2>B< */>\n"
2160 "B< uint32_t *>I<uaddr2>B<, uint32_t >I<val3>B<);>\n"
2161 msgstr ""
2162 "B<long syscall(SYS_futex, uint32_t *>I<uaddr>B<, int >I<futex_op>B<, uint32_t >I<val>B<,>\n"
2163 "B< const struct timespec *>I<timeout>B<,>I< > /* ou : B<uint32_t >I<val2>B< */>\n"
2164 "B< uint32_t *>I<uaddr2>B<, uint32_t >I<val3>B<);>\n"
2165
2166 #. type: Plain text
2167 #: debian-trixie fedora-44 fedora-rawhide
2168 msgid ""
2169 "I<Note>: glibc provides no wrapper for B<futex>(), necessitating the use of "
2170 "B<syscall>(2)."
2171 msgstr ""
2172 "I<Remarque> : la glibc ne fournit pas de fonction autour de B<futex>(), "
2173 "nécessitant l'utilisation de B<syscall>(2)."
2174
2175 #. type: Plain text
2176 #: debian-trixie fedora-44 fedora-rawhide
2177 msgid ""
2178 "Note that no explicit initialization or destruction is necessary to use "
2179 "futexes; the kernel maintains a futex (i.e., the kernel-internal "
2180 "implementation artifact) only while operations such as B<FUTEX_WAIT>, "
2181 "described below, are being performed on a particular futex word."
2182 msgstr ""
2183 "Remarquez qu'aucune initialisation ou destruction explicite n'est nécessaire "
2184 "pour utiliser les futex ; le noyau ne garde un futex (c'est-à-dire un "
2185 "artefact d'implémentation interne au noyau) que pendant que les opérations "
2186 "telles que B<FUTEX_WAIT>, décrite ci-dessous, s'effectuent sur un mot futex "
2187 "en particulier."
2188
2189 #. type: Plain text
2190 #: debian-trixie fedora-44 fedora-rawhide
2191 msgid ""
2192 "The I<uaddr> argument points to the futex word. On all platforms, futexes "
2193 "are four-byte integers that must be aligned on a four-byte boundary. The "
2194 "operation to perform on the futex is specified in the I<futex_op> argument; "
2195 "I<val> is a value whose meaning and purpose depends on I<futex_op>."
2196 msgstr ""
2197 "Le paramètre I<uaddr> pointe vers un mot futex. Sur toutes les plateformes, "
2198 "les futex sont des entiers de quatre octets qui doivent être alignés sur une "
2199 "limite de quatre octets. L'opération à effectuer sur le futex est indiquée "
2200 "dans le paramètre de I<futex_op> ; I<val> est une valeur dont la "
2201 "signification et l'objectif dépendent de I<futex_op>."
2202
2203 #. type: Plain text
2204 #: debian-trixie fedora-44 fedora-rawhide
2205 msgid ""
2206 "The remaining arguments (I<timeout>, I<uaddr2>, and I<val3>) are required "
2207 "only for certain of the futex operations described below. Where one of "
2208 "these arguments is not required, it is ignored."
2209 msgstr ""
2210 "Les autres paramètres (I<timeout>, I<uaddr2> et I<val3>) ne sont nécessaires "
2211 "que pour certaines opérations futex décrites ci-dessous. Si un de ces "
2212 "arguments n'est pas nécessaire, il est ignoré."
2213
2214 #. type: Plain text
2215 #: debian-trixie fedora-44 fedora-rawhide
2216 msgid ""
2217 "For several blocking operations, the I<timeout> argument is a pointer to a "
2218 "I<timespec> structure that specifies a timeout for the operation. However, "
2219 "notwithstanding the prototype shown above, for some operations, the least "
2220 "significant four bytes of this argument are instead used as an integer whose "
2221 "meaning is determined by the operation. For these operations, the kernel "
2222 "casts the I<timeout> value first to I<unsigned long>, then to I<uint32_t>, "
2223 "and in the remainder of this page, this argument is referred to as I<val2> "
2224 "when interpreted in this fashion."
2225 msgstr ""
2226 "Pour plusieurs opérations de blocage, le paramètre I<timeout> est un "
2227 "pointeur vers une structure I<timespec> qui indique la durée maximale de "
2228 "l'opération. Toutefois, contrairement au prototype décrit ci-dessus, pour "
2229 "certaines opérations, les quatre octets les moins significatifs de ce "
2230 "paramètre sont utilisés comme un entier dont la signification est déterminée "
2231 "par l'opération. Pour ces opérations, le noyau diffuse la valeur I<timeout> "
2232 "d'abord à I<unsigned long>, puis à I<uint32_t>, et dans le reste de cette "
2233 "page, ce paramètre est désigné par I<val2> quand il est interprété de cette "
2234 "manière."
2235
2236 #. type: Plain text
2237 #: debian-trixie fedora-44 fedora-rawhide
2238 msgid ""
2239 "Where it is required, the I<uaddr2> argument is a pointer to a second futex "
2240 "word that is employed by the operation."
2241 msgstr ""
2242 "Lorsqu'il est nécessaire, le paramètre I<uaddr2> est un pointeur vers un "
2243 "deuxième mot futex utilisé par l'opération."
2244
2245 #
2246 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2247 #. type: Plain text
2248 #: debian-trixie fedora-44 fedora-rawhide
2249 msgid ""
2250 "The interpretation of the final integer argument, I<val3>, depends on the "
2251 "operation."
2252 msgstr ""
2253 "L'interprétation du paramètre de l'entier final, I<val3>, dépend de "
2254 "l'opération."
2255
2256 #. type: Plain text
2257 #: debian-trixie fedora-44 fedora-rawhide
2258 msgid ""
2259 "The I<futex_op> argument consists of two parts: a command that specifies the "
2260 "operation to be performed, bitwise ORed with zero or more options that "
2261 "modify the behaviour of the operation. The options that may be included in "
2262 "I<futex_op> are as follows:"
2263 msgstr ""
2264 "Le paramètre I<futex_op> est en deux parties : une commande qui indique "
2265 "l'opération à effectuer et un bit ORed avec zéro ou plusieurs options qui "
2266 "changent le comportement de l'opération. Les options qui peuvent être "
2267 "incluses dans I<futex_op> sont les suivantes :"
2268
2269 #. commit 1acdac104668a0834cfa267de9946fac7764d486
2270 #. commit 337f13046ff03717a9e99675284a817527440a49
2271 #. commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
2272 #. type: Plain text
2273 #: debian-trixie fedora-44 fedora-rawhide
2274 msgid ""
2275 "This option bit can be employed only with the B<FUTEX_WAIT_BITSET>, "
2276 "B<FUTEX_WAIT_REQUEUE_PI>, (since Linux 4.5) B<FUTEX_WAIT>, and (since Linux "
2277 "5.14) B<FUTEX_LOCK_PI2> operations."
2278 msgstr ""
2279 "Ce bit d'option ne peut être utilisé qu'avec les opérations "
2280 "B<FUTEX_WAIT_BITSET>, B<FUTEX_WAIT_REQUEUE_PI> (depuis Linux 4.5), "
2281 "B<FUTEX_WAIT> (depuis Linux 4.5) et B<FUTEX_LOCK_PI2> (depuis Linux 5.14)."
2282
2283 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2284 #. type: Plain text
2285 #: debian-trixie fedora-44 fedora-rawhide
2286 msgid "The operation specified in I<futex_op> is one of the following:"
2287 msgstr "L'opération indiquée dans I<futex_op> prend une de ces valeurs\\ :"
2288
2289 #. type: TP
2290 #: debian-trixie fedora-44 fedora-rawhide
2291 #, no-wrap
2292 msgid "B<FUTEX_WAIT> (since Linux 2.6.0)"
2293 msgstr "B<FUTEX_WAIT> (depuis Linux 2.6.0)"
2294
2295 #. Strictly speaking, since some time in Linux 2.5.x
2296 #. FIXME: Torvald, I think we may need to add some explanation of
2297 #. "totally ordered" here.
2298 #. type: Plain text
2299 #: debian-trixie fedora-44 fedora-rawhide
2300 msgid ""
2301 "This operation tests that the value at the futex word pointed to by the "
2302 "address I<uaddr> still contains the expected value I<val>, and if so, then "
2303 "sleeps waiting for a B<FUTEX_WAKE> operation on the futex word. The load of "
2304 "the value of the futex word is an atomic memory access (i.e., using atomic "
2305 "machine instructions of the respective architecture). This load, the "
2306 "comparison with the expected value, and starting to sleep are performed "
2307 "atomically and totally ordered with respect to other futex operations on the "
2308 "same futex word. If the thread starts to sleep, it is considered a waiter "
2309 "on this futex word. If the futex value does not match I<val>, then the call "
2310 "fails immediately with the error B<EAGAIN>."
2311 msgstr ""
2312 "Cette option teste que la valeur du mot futex vers laquelle pointe l'adresse "
2313 "I<uaddr> contient toujours la valeur I<val> attendue, et si tel est le cas, "
2314 "elle s'endort jusqu'à une opération B<FUTEX_WAKE> sur le mot futex. Le "
2315 "chargement de la valeur du mot futex est un accès en mémoire atomique (c'est-"
2316 "à-dire qu'il utilise des instructions machine atomiques de l'architecture "
2317 "concernée). Ce chargement, la comparaison avec la valeur attendue et la mise "
2318 "en sommeil s'effectuent de manière atomique et sont totalement organisés "
2319 "selon les autres opérations futex sur le même mot futex. Si le thread "
2320 "commence à dormir, il est considéré comme en attente de ce mot futex. Si la "
2321 "valeur futex ne correspond pas à I<val>, l'appel échoue immédiatement avec "
2322 "l'erreur B<EAGAIN>."
2323
2324 #. type: Plain text
2325 #: debian-trixie fedora-44 fedora-rawhide
2326 msgid ""
2327 "The purpose of the comparison with the expected value is to prevent lost "
2328 "wake-ups. If another thread changed the value of the futex word after the "
2329 "calling thread decided to block based on the prior value, and if the other "
2330 "thread executed a B<FUTEX_WAKE> operation (or similar wake-up) after the "
2331 "value change and before this B<FUTEX_WAIT> operation, then the calling "
2332 "thread will observe the value change and will not start to sleep."
2333 msgstr ""
2334 "Le but de la comparaison avec la valeur attendue est d'empêcher des réveils "
2335 "perdus. Si un autre thread a changé la valeur du mot futex après que le "
2336 "thread a décidé de se bloquer en se fondant sur la valeur d'avant, et si "
2337 "l'autre thread a effectué une opération B<FUTEX_WAKE> (ou un réveil "
2338 "équivalent) après le changement de cette valeur et avant cette opération "
2339 "B<FUTEX_WAIT>, le thread appelant observera cette valeur et ne commencera "
2340 "pas à dormir."
2341
2342 #. type: Plain text
2343 #: debian-trixie fedora-44 fedora-rawhide
2344 msgid ""
2345 "If the I<timeout> is not NULL, the structure it points to specifies a "
2346 "timeout for the wait. (This interval will be rounded up to the system clock "
2347 "granularity, and is guaranteed not to expire early.) The timeout is by "
2348 "default measured according to the B<CLOCK_MONOTONIC> clock, but, since Linux "
2349 "4.5, the B<CLOCK_REALTIME> clock can be selected by specifying "
2350 "B<FUTEX_CLOCK_REALTIME> in I<futex_op>. If I<timeout> is NULL, the call "
2351 "blocks indefinitely."
2352 msgstr ""
2353 "Si le I<timeout> n'est pas NULL, la structure vers laquelle il pointe "
2354 "indique un délai d'attente (cet intervalle sera arrondi à la valeur "
2355 "supérieure à partir de la granularité de l'horloge système et il est garanti "
2356 "de ne pas expirer en avance). Le délai est mesuré par défaut par rapport à "
2357 "l'horloge B<CLOCK_MONOTONIC> mais depuis Linux 4.5, l'horloge "
2358 "B<CLOCK_REALTIME> peut être choisie en indiquant B<FUTEX_CLOCK_REALTIME> "
2359 "dans I<futex_op>. Si le I<timeout> est NULL, l'appel se bloque indéfiniment."
2360
2361 #. type: Plain text
2362 #: debian-trixie fedora-44 fedora-rawhide
2363 msgid ""
2364 "I<Note>: for B<FUTEX_WAIT>, I<timeout> is interpreted as a I<relative> "
2365 "value. This differs from other futex operations, where I<timeout> is "
2366 "interpreted as an absolute value. To obtain the equivalent of B<FUTEX_WAIT> "
2367 "with an absolute timeout, employ B<FUTEX_WAIT_BITSET> with I<val3> specified "
2368 "as B<FUTEX_BITSET_MATCH_ANY>."
2369 msgstr ""
2370 "I<Remarque> : pour B<FUTEX_WAIT>, le I<timeout> est interprété comme une "
2371 "I<valeur> relative. Cela diffère des autres opérations futex où le "
2372 "I<timeout> est interprété comme une valeur absolue. Pour obtenir "
2373 "l'équivalent de B<FUTEX_WAIT>, avec un délai absolu, utilisez "
2374 "B<FUTEX_WAIT_BITSET> en indiquant I<val3> comme B<FUTEX_BITSET_MATCH_ANY>."
2375
2376 #
2377 #
2378 #. FIXME . (Torvald) I think we should remove this. Or maybe adapt to a
2379 #. different example.
2380 #. For
2381 #. .BR futex (7),
2382 #. this call is executed if decrementing the count gave a negative value
2383 #. (indicating contention),
2384 #. and will sleep until another process or thread releases
2385 #. the futex and executes the
2386 #. .B FUTEX_WAKE
2387 #. operation.
2388 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2389 #. type: Plain text
2390 #: debian-trixie fedora-44 fedora-rawhide
2391 msgid "The arguments I<uaddr2> and I<val3> are ignored."
2392 msgstr "Les paramètres I<uaddr2> et I<val3> sont ignorés."
2393
2394 #. type: TP
2395 #: debian-trixie fedora-44 fedora-rawhide
2396 #, no-wrap
2397 msgid "B<FUTEX_WAKE> (since Linux 2.6.0)"
2398 msgstr "B<FUTEX_WAKE> (depuis Linux 2.6.0)"
2399
2400 #. Strictly speaking, since Linux 2.5.x
2401 #. type: Plain text
2402 #: debian-trixie fedora-44 fedora-rawhide
2403 msgid ""
2404 "This operation wakes at most I<val> of the waiters that are waiting (e.g., "
2405 "inside B<FUTEX_WAIT>) on the futex word at the address I<uaddr>. Most "
2406 "commonly, I<val> is specified as either 1 (wake up a single waiter) or "
2407 "B<INT_MAX> (wake up all waiters). No guarantee is provided about which "
2408 "waiters are awoken (e.g., a waiter with a higher scheduling priority is not "
2409 "guaranteed to be awoken in preference to a waiter with a lower priority)."
2410 msgstr ""
2411 "Cette opération réveille jusqu'à I<val> éléments en attente (comme dans "
2412 "B<FUTEX_WAIT>) sur le mot futex à l'adresse I<uaddr>. Généralement, I<val> "
2413 "est indiqué soit sous la forme de B<1> (réveil d'un seul élément en attente) "
2414 "soit avec B<INT_MAX> (réveil de tous les éléments en attente). Vous n'avez "
2415 "aucune garantie quant aux éléments qui sont réveillés (par exemple un "
2416 "élément en attente dont la priorité d'ordonnancement élevée n'est pas "
2417 "garanti de se réveiller avant un autre d'une priorité plus basse)."
2418
2419 #
2420 #
2421 #
2422 #. type: Plain text
2423 #: debian-trixie fedora-44 fedora-rawhide
2424 msgid "The arguments I<timeout>, I<uaddr2>, and I<val3> are ignored."
2425 msgstr "Les paramètres I<timeout>, I<uaddr2> et I<val3> sont ignorés."
2426
2427 #. type: TP
2428 #: debian-trixie fedora-44 fedora-rawhide
2429 #, no-wrap
2430 msgid "B<FUTEX_FD> (from Linux 2.6.0 up to and including Linux 2.6.25)"
2431 msgstr "B<FUTEX_FD> (de Linux 2.6.0 jusqu'à Linux 2.6.25 inclus)"
2432
2433 #. Strictly speaking, from Linux 2.5.x to Linux 2.6.25
2434 #. type: Plain text
2435 #: debian-trixie fedora-44 fedora-rawhide
2436 msgid ""
2437 "This operation creates a file descriptor that is associated with the futex "
2438 "at I<uaddr>. The caller must close the returned file descriptor after use. "
2439 "When another process or thread performs a B<FUTEX_WAKE> on the futex word, "
2440 "the file descriptor indicates as being readable with B<select>(2), "
2441 "B<poll>(2), and B<epoll>(7)"
2442 msgstr ""
2443 "Cette opération crée un descripteur de fichier associé au futex sur "
2444 "I<uaddr>. L'appelant doit fermer le descripteur de fichier renvoyé après "
2445 "l'avoir utilisé. Quand un autre processus ou un autre thread effectue un "
2446 "B<FUTEX_WAKE> sur le mot futex, le descripteur de fichier indique qu'il est "
2447 "accessible en lecture avec B<select>(2), B<poll>(2), et B<epoll>(7)"
2448
2449 #. type: Plain text
2450 #: debian-trixie fedora-44 fedora-rawhide
2451 msgid ""
2452 "The file descriptor can be used to obtain asynchronous notifications: if "
2453 "I<val> is nonzero, then, when another process or thread executes a "
2454 "B<FUTEX_WAKE>, the caller will receive the signal number that was passed in "
2455 "I<val>."
2456 msgstr ""
2457 "Le descripteur de fichier peut être utilisé pour avoir des notifications "
2458 "asynchrones, si I<val> n'est pas nul, puis, quand un autre processus ou un "
2459 "autre thread exécute B<FUTEX_WAKE>, l'appelant recevra le numéro du signal "
2460 "passé à I<val>."
2461
2462 #. commit 82af7aca56c67061420d618cc5a30f0fd4106b80
2463 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2464 #. type: Plain text
2465 #: debian-trixie fedora-44 fedora-rawhide
2466 msgid ""
2467 "Because it was inherently racy, B<FUTEX_FD> has been removed from Linux "
2468 "2.6.26 onward."
2469 msgstr ""
2470 "Parce qu'il était de façon inhérente sujet à des situations de concurrence, "
2471 "B<FUTEX_FD> a été supprimé de Linux 2.6.26 et les suivants."
2472
2473 #. type: TP
2474 #: debian-trixie fedora-44 fedora-rawhide
2475 #, no-wrap
2476 msgid "B<FUTEX_REQUEUE> (since Linux 2.6.0)"
2477 msgstr "B<FUTEX_REQUEUE> (depuis Linux 2.6.0)"
2478
2479 #
2480 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2481 #. type: Plain text
2482 #: debian-trixie fedora-44 fedora-rawhide
2483 msgid ""
2484 "This operation performs the same task as B<FUTEX_CMP_REQUEUE> (see below), "
2485 "except that no check is made using the value in I<val3>. (The argument "
2486 "I<val3> is ignored.)"
2487 msgstr ""
2488 "Cette opération effectue la même chose que B<FUTEX_CMP_REQUEUE> (voir ci-"
2489 "dessous), sauf qu'elle ne vérifie rien en utilisant la valeur dans I<val3> "
2490 "(le paramètre I<val3> est ignoré)."
2491
2492 #. type: TP
2493 #: debian-trixie fedora-44 fedora-rawhide
2494 #, no-wrap
2495 msgid "B<FUTEX_CMP_REQUEUE> (since Linux 2.6.7)"
2496 msgstr "B<FUTEX_CMP_REQUEUE> (depuis Linux 2.6.7)"
2497
2498 #. type: Plain text
2499 #: debian-trixie fedora-44 fedora-rawhide
2500 msgid ""
2501 "This operation first checks whether the location I<uaddr> still contains the "
2502 "value I<val3>. If not, the operation fails with the error B<EAGAIN>. "
2503 "Otherwise, the operation wakes up a maximum of I<val> waiters that are "
2504 "waiting on the futex at I<uaddr>. If there are more than I<val> waiters, "
2505 "then the remaining waiters are removed from the wait queue of the source "
2506 "futex at I<uaddr> and added to the wait queue of the target futex at "
2507 "I<uaddr2>. The I<val2> argument specifies an upper limit on the number of "
2508 "waiters that are requeued to the futex at I<uaddr2>."
2509 msgstr ""
2510 "Cette opération vérifie d'abord si l'emplacement I<uaddr> contient toujours "
2511 "la valeur I<val3>. Si tel n'est pas le cas, l'opération échoue avec l'erreur "
2512 "B<EAGAIN>. Si tel est le cas, l'opération réveille un maximum de I<val> "
2513 "éléments en attente du futex sur I<uaddr>. S'il y a plus de I<val> éléments "
2514 "en attente, les autres sont supprimés de la file d'attente du futex source "
2515 "sur I<uaddr> et ajoutés à la file d'attente du futex cible sur I<uaddr2>. Le "
2516 "paramètre I<val2> indique une limite supérieure du nombre d'éléments remis "
2517 "en attente dans le futex sur I<uaddr2>."
2518
2519 #. FIXME(Torvald) Is the following correct? Or is just the decision
2520 #. which threads to wake or requeue part of the atomic operation?
2521 #. Notes from a f2f conversation with Thomas Gleixner (Aug 2015): ###
2522 #. The operation is serialized with respect to operations on both
2523 #. source and target futex. No other waiter can enqueue itself
2524 #. for waiting and no other waiter can dequeue itself because of
2525 #. a timeout or signal.
2526 #. type: Plain text
2527 #: debian-trixie fedora-44 fedora-rawhide
2528 msgid ""
2529 "The load from I<uaddr> is an atomic memory access (i.e., using atomic "
2530 "machine instructions of the respective architecture). This load, the "
2531 "comparison with I<val3>, and the requeueing of any waiters are performed "
2532 "atomically and totally ordered with respect to other operations on the same "
2533 "futex word."
2534 msgstr ""
2535 "Le chargement à partir de I<uaddr> est un accès atomique en mémoire (c'est-à-"
2536 "dire qu'il utilise les instructions machine atomiques de l'architecture "
2537 "concernée). Ce chargement, la comparaison avec I<val3> et la remise en "
2538 "attente d'éléments s'effectuent de manière atomique et sont totalement "
2539 "organisées par rapport aux autres opérations sur le même mot futex."
2540
2541 #. type: Plain text
2542 #: debian-trixie fedora-44 fedora-rawhide
2543 msgid ""
2544 "Typical values to specify for I<val> are 0 or 1. (Specifying B<INT_MAX> is "
2545 "not useful, because it would make the B<FUTEX_CMP_REQUEUE> operation "
2546 "equivalent to B<FUTEX_WAKE>.) The limit value specified via I<val2> is "
2547 "typically either 1 or B<INT_MAX>. (Specifying the argument as 0 is not "
2548 "useful, because it would make the B<FUTEX_CMP_REQUEUE> operation equivalent "
2549 "to B<FUTEX_WAIT>.)"
2550 msgstr ""
2551 "Les valeurs classiques qu'on indique à I<val> sont B<0> ou B<1> (indiquer "
2552 "B<INT_MAX> n'est pas utile car cela rendrait l'opération "
2553 "B<FUTEX_CMP_REQUEUE> équivalente à B<FUTEX_WAKE>). La valeur limite indiquée "
2554 "avec I<val2> est généralement B<1> ou B<INT_MAX> (indiquer B<0> en paramètre "
2555 "n'est pas utile car cela rendrait l'opération B<FUTEX_CMP_REQUEUE> "
2556 "équivalente à B<FUTEX_WAIT>)."
2557
2558 #. But, as Rich Felker points out, there remain valid use cases for
2559 #. FUTEX_REQUEUE, for example, when the calling thread is requeuing
2560 #. the target(s) to a lock that the calling thread owns
2561 #. From: Rich Felker <[email protected]>
2562 #. Date: Wed, 29 Oct 2014 22:43:17 -0400
2563 #. To: Darren Hart <[email protected]>
2564 #. CC: [email protected], ...
2565 #. Subject: Re: Add futex wrapper to glibc?
2566 #. type: Plain text
2567 #: debian-trixie fedora-44 fedora-rawhide
2568 msgid ""
2569 "The B<FUTEX_CMP_REQUEUE> operation was added as a replacement for the "
2570 "earlier B<FUTEX_REQUEUE>. The difference is that the check of the value at "
2571 "I<uaddr> can be used to ensure that requeueing happens only under certain "
2572 "conditions, which allows race conditions to be avoided in certain use cases."
2573 msgstr ""
2574 "L'opération B<FUTEX_CMP_REQUEUE> a été ajoutée pour remplacer l'ancienne "
2575 "B<FUTEX_REQUEUE>. La différence est que la vérification de la valeur sur "
2576 "I<uaddr> peut être utilisée pour s'assurer que la remise en attente ne se "
2577 "produit que sous certaines conditions, ce qui évite les conflits de mémoire "
2578 "(race conditions) dans certains cas d'utilisation."
2579
2580 #. type: Plain text
2581 #: debian-trixie fedora-44 fedora-rawhide
2582 msgid ""
2583 "Both B<FUTEX_REQUEUE> and B<FUTEX_CMP_REQUEUE> can be used to avoid "
2584 "\"thundering herd\" wake-ups that could occur when using B<FUTEX_WAKE> in "
2585 "cases where all of the waiters that are woken need to acquire another "
2586 "futex. Consider the following scenario, where multiple waiter threads are "
2587 "waiting on B, a wait queue implemented using a futex:"
2588 msgstr ""
2589 "B<FUTEX_REQUEUE> et B<FUTEX_CMP_REQUEUE> peuvent être utilisées pour éviter "
2590 "des réveils en troupeau (thundering herd) qui peuvent survenir quand on "
2591 "utilise B<FUTEX_WAKE> dans des cas où tous les éléments en attente qu'on "
2592 "réveille doivent acquérir un autre futex. Imaginons le scénario suivant où "
2593 "plusieurs threads attendent en B, une file d'attente implémentée en "
2594 "utilisant un futex :"
2595
2596 #. type: Plain text
2597 #: debian-trixie fedora-44 fedora-rawhide
2598 #, no-wrap
2599 msgid ""
2600 "lock(A)\n"
2601 "while (!check_value(V)) {\n"
2602 " unlock(A);\n"
2603 " block_on(B);\n"
2604 " lock(A);\n"
2605 "};\n"
2606 "unlock(A);\n"
2607 msgstr ""
2608 "lock(A)\n"
2609 "while (!check_value(V)) {\n"
2610 " unlock(A);\n"
2611 " block_on(B);\n"
2612 " lock(A);\n"
2613 "};\n"
2614 "unlock(A);\n"
2615
2616 #
2617 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2618 #. type: Plain text
2619 #: debian-trixie fedora-44 fedora-rawhide
2620 msgid ""
2621 "If a waker thread used B<FUTEX_WAKE>, then all waiters waiting on B would be "
2622 "woken up, and they would all try to acquire lock A. However, waking all of "
2623 "the threads in this manner would be pointless because all except one of the "
2624 "threads would immediately block on lock A again. By contrast, a requeue "
2625 "operation wakes just one waiter and moves the other waiters to lock A, and "
2626 "when the woken waiter unlocks A then the next waiter can proceed."
2627 msgstr ""
2628 "Si un thread qui se réveille utilisait B<FUTEX_WAKE>, tous les éléments "
2629 "attendant en B se réveilleraient et essaieraient d'acquérir le verrou A. "
2630 "Cependant, réveiller tous ces threads de cette manière serait vain car tous "
2631 "les threads, sauf un, se bloqueraient immédiatement à nouveau via le verrou "
2632 "A. Au contraire, une remise dans la file d'attente ne réveille qu'un élément "
2633 "et déplace les autres sur le verrou A et quand celui réveillé déverrouille "
2634 "A, le suivant peut continuer."
2635
2636 #. type: TP
2637 #: debian-trixie fedora-44 fedora-rawhide
2638 #, no-wrap
2639 msgid "B<FUTEX_WAKE_OP> (since Linux 2.6.14)"
2640 msgstr "B<FUTEX_WAKE_OP> (depuis Linux 2.6.14)"
2641
2642 #. commit 4732efbeb997189d9f9b04708dc26bf8613ed721
2643 #. Author: Jakub Jelinek <[email protected]>
2644 #. Date: Tue Sep 6 15:16:25 2005 -0700
2645 #. FIXME. (Torvald) The glibc condvar implementation is currently being
2646 #. revised (e.g., to not use an internal lock anymore).
2647 #. It is probably more future-proof to remove this paragraph.
2648 #. [Torvald, do you have an update here?]
2649 #. type: Plain text
2650 #: debian-trixie fedora-44 fedora-rawhide
2651 msgid ""
2652 "This operation was added to support some user-space use cases where more "
2653 "than one futex must be handled at the same time. The most notable example "
2654 "is the implementation of B<pthread_cond_signal>(3), which requires "
2655 "operations on two futexes, the one used to implement the mutex and the one "
2656 "used in the implementation of the wait queue associated with the condition "
2657 "variable. B<FUTEX_WAKE_OP> allows such cases to be implemented without "
2658 "leading to high rates of contention and context switching."
2659 msgstr ""
2660 "Cette opération a été ajoutée pour prendre en charge certains cas "
2661 "d'utilisation de l'espace utilisateur où plus d'un futex à la fois doit être "
2662 "géré. L'exemple le plus frappant est l'implémentation de "
2663 "B<pthread_cond_signal>(3), qui nécessite des opérations sur deux futex, une "
2664 "pour implémenter le mutex, l'autre pour utiliser dans l'implémentation de la "
2665 "file d'attente associée à la variable conditionnelle. B<FUTEX_WAKE_OP> "
2666 "permet d'implémenter de tels cas sans augmenter le nombre de conflits et de "
2667 "changement de contexte."
2668
2669 #. type: Plain text
2670 #: debian-trixie fedora-44 fedora-rawhide
2671 msgid ""
2672 "The B<FUTEX_WAKE_OP> operation is equivalent to executing the following code "
2673 "atomically and totally ordered with respect to other futex operations on any "
2674 "of the two supplied futex words:"
2675 msgstr ""
2676 "L'opération B<FUTEX_ WAKE_OP> revient à exécuter le code suivant de manière "
2677 "atomique et complètement organisé en fonction des opérations futex sur un "
2678 "des deux mots futex fournis :"
2679
2680 #. type: Plain text
2681 #: debian-trixie fedora-44 fedora-rawhide
2682 #, no-wrap
2683 msgid ""
2684 "uint32_t oldval = *(uint32_t *) uaddr2;\n"
2685 "*(uint32_t *) uaddr2 = oldval I<op> I<oparg>;\n"
2686 "futex(uaddr, FUTEX_WAKE, val, 0, 0, 0);\n"
2687 "if (oldval I<cmp> I<cmparg>)\n"
2688 " futex(uaddr2, FUTEX_WAKE, val2, 0, 0, 0);\n"
2689 msgstr ""
2690 "uint32_t oldval = *(uint32_t *) uaddr2;\n"
2691 "*(uint32_t *) uaddr2 = oldval I<op> I<oparg>;\n"
2692 "futex(uaddr, FUTEX_WAKE, val, 0, 0, 0);\n"
2693 "if (oldval I<cmp> I<cmparg>)\n"
2694 " futex(uaddr2, FUTEX_WAKE, val2, 0, 0, 0);\n"
2695
2696 #. type: Plain text
2697 #: debian-trixie fedora-44 fedora-rawhide
2698 msgid "In other words, B<FUTEX_WAKE_OP> does the following:"
2699 msgstr "En d'autres termes, B<FUTEX_WAKE_OP> fait ce qui suit :"
2700
2701 #. type: Plain text
2702 #: debian-trixie fedora-44 fedora-rawhide
2703 msgid ""
2704 "saves the original value of the futex word at I<uaddr2> and performs an "
2705 "operation to modify the value of the futex at I<uaddr2>; this is an atomic "
2706 "read-modify-write memory access (i.e., using atomic machine instructions of "
2707 "the respective architecture)"
2708 msgstr ""
2709 "sauvegarde la valeur d'origine du mot futex sur I<uaddr2> et effectue une "
2710 "opération pour modifier la valeur du futex sur I<uaddr2> ; il s'agit d'un "
2711 "accès en mémoire read-modify-write atomique (c'est-à-dire d'une utilisation "
2712 "des instructions machine atomiques liées à l'architecture concernée)"
2713
2714 #. type: Plain text
2715 #: debian-trixie fedora-44 fedora-rawhide
2716 msgid ""
2717 "wakes up a maximum of I<val> waiters on the futex for the futex word at "
2718 "I<uaddr>; and"
2719 msgstr ""
2720 "réveille un maximum de I<val> éléments en attente sur le futex pour le mot "
2721 "futex sur I<uaddr> ;"
2722
2723 #. type: Plain text
2724 #: debian-trixie fedora-44 fedora-rawhide
2725 msgid ""
2726 "dependent on the results of a test of the original value of the futex word "
2727 "at I<uaddr2>, wakes up a maximum of I<val2> waiters on the futex for the "
2728 "futex word at I<uaddr2>."
2729 msgstr ""
2730 "et selon les résultats d'un test de la valeur d'origine du mot futex sur "
2731 "I<uaddr2>, réveille un maximum de I<val2> éléments en attente du mot futex "
2732 "sur le futex sur I<uaddr2>."
2733
2734 #. type: Plain text
2735 #: debian-trixie fedora-44 fedora-rawhide
2736 msgid ""
2737 "The operation and comparison that are to be performed are encoded in the "
2738 "bits of the argument I<val3>. Pictorially, the encoding is:"
2739 msgstr ""
2740 "L'opération et la comparaison qui doivent être effectuées sont encodées dans "
2741 "les bits du paramètre I<val3>. Visuellement, l'encodage est :"
2742
2743 #. type: Plain text
2744 #: debian-trixie fedora-44 fedora-rawhide
2745 #, no-wrap
2746 msgid ""
2747 "+---+---+-----------+-----------+\n"
2748 "|op |cmp| oparg | cmparg |\n"
2749 "+---+---+-----------+-----------+\n"
2750 " 4 4 12 12 E<lt>== # of bits\n"
2751 msgstr ""
2752 "+---+---+-----------+-----------+\n"
2753 "|op |cmp| oparg | cmparg |\n"
2754 "+---+---+-----------+-----------+\n"
2755 " 4 4 12 12 E<lt>== # of bits\n"
2756
2757 #. type: Plain text
2758 #: debian-trixie fedora-44 fedora-rawhide
2759 msgid "Expressed in code, the encoding is:"
2760 msgstr "Exprimé en code, l'encodage est :"
2761
2762 #. type: Plain text
2763 #: debian-trixie fedora-44 fedora-rawhide
2764 #, no-wrap
2765 msgid ""
2766 "#define FUTEX_OP(op, oparg, cmp, cmparg) \\[rs]\n"
2767 " (((op & 0xf) E<lt>E<lt> 28) | \\[rs]\n"
2768 " ((cmp & 0xf) E<lt>E<lt> 24) | \\[rs]\n"
2769 " ((oparg & 0xfff) E<lt>E<lt> 12) | \\[rs]\n"
2770 " (cmparg & 0xfff))\n"
2771 msgstr ""
2772 "#define FUTEX_OP(op, oparg, cmp, cmparg) \\[rs]\n"
2773 " (((op & 0xf) E<lt>E<lt> 28) | \\[rs]\n"
2774 " ((cmp & 0xf) E<lt>E<lt> 24) | \\[rs]\n"
2775 " ((oparg & 0xfff) E<lt>E<lt> 12) | \\[rs]\n"
2776 " (cmparg & 0xfff))\n"
2777
2778 #. type: Plain text
2779 #: debian-trixie fedora-44 fedora-rawhide
2780 msgid ""
2781 "In the above, I<op> and I<cmp> are each one of the codes listed below. The "
2782 "I<oparg> and I<cmparg> components are literal numeric values, except as "
2783 "noted below."
2784 msgstr ""
2785 "Dans ce qui précède, I<op> et I<cmp> sont chacun des codes listés ci-"
2786 "dessous. Les composants I<oparg> et I<cmparg> sont des valeurs numériques "
2787 "littérales, sauf les remarques ci-dessous."
2788
2789 #. type: Plain text
2790 #: debian-trixie fedora-44 fedora-rawhide
2791 msgid "The I<op> component has one of the following values:"
2792 msgstr "Le composant I<op> prend une de ces valeurs\\ :"
2793
2794 #. type: Plain text
2795 #: debian-trixie fedora-44 fedora-rawhide
2796 #, no-wrap
2797 msgid ""
2798 "FUTEX_OP_SET 0 /* uaddr2 = oparg; */\n"
2799 "FUTEX_OP_ADD 1 /* uaddr2 += oparg; */\n"
2800 "FUTEX_OP_OR 2 /* uaddr2 |= oparg; */\n"
2801 "FUTEX_OP_ANDN 3 /* uaddr2 &= \\[ti]oparg; */\n"
2802 "FUTEX_OP_XOR 4 /* uaddr2 \\[ha]= oparg; */\n"
2803 msgstr ""
2804 "FUTEX_OP_SET 0 /* uaddr2 = oparg; */\n"
2805 "FUTEX_OP_ADD 1 /* uaddr2 += oparg; */\n"
2806 "FUTEX_OP_OR 2 /* uaddr2 |= oparg; */\n"
2807 "FUTEX_OP_ANDN 3 /* uaddr2 &= \\[ti]oparg; */\n"
2808 "FUTEX_OP_XOR 4 /* uaddr2 \\[ha]= oparg; */\n"
2809
2810 #. type: Plain text
2811 #: debian-trixie fedora-44 fedora-rawhide
2812 #, fuzzy
2813 #| msgid ""
2814 #| "In addition, bitwise ORing the following value into I<op> causes I<(1\\ "
2815 #| "E<lt>E<lt>\\ oparg)> to be used as the operand:"
2816 msgid ""
2817 "In addition, bitwise ORing the following value into I<op> causes I<(1\\ "
2818 "E<lt>E<lt>\\ oparg)> to be used as the operand:"
2819 msgstr ""
2820 "En outre, comparer bit à bit (ORing) la valeur suivante dans I<op> a pour "
2821 "conséquence que I<(1\\ E<lt>E<lt>\\ oparg)> sera utilisé en tant "
2822 "qu'opérande :"
2823
2824 #. type: Plain text
2825 #: debian-trixie fedora-44 fedora-rawhide
2826 #, no-wrap
2827 msgid "FUTEX_OP_ARG_SHIFT 8 /* Use (1 E<lt>E<lt> oparg) as operand */\n"
2828 msgstr "FUTEX_OP_ARG_SHIFT 8 /* Utiliser (1 E<lt>E<lt> oparg) comme opérande */\n"
2829
2830 #. type: Plain text
2831 #: debian-trixie fedora-44 fedora-rawhide
2832 msgid "The I<cmp> field is one of the following:"
2833 msgstr "Le champ I<cmp> prend une de ces valeurs\\ :"
2834
2835 #. type: Plain text
2836 #: debian-trixie fedora-44 fedora-rawhide
2837 #, no-wrap
2838 msgid ""
2839 "FUTEX_OP_CMP_EQ 0 /* if (oldval == cmparg) wake */\n"
2840 "FUTEX_OP_CMP_NE 1 /* if (oldval != cmparg) wake */\n"
2841 "FUTEX_OP_CMP_LT 2 /* if (oldval E<lt> cmparg) wake */\n"
2842 "FUTEX_OP_CMP_LE 3 /* if (oldval E<lt>= cmparg) wake */\n"
2843 "FUTEX_OP_CMP_GT 4 /* if (oldval E<gt> cmparg) wake */\n"
2844 "FUTEX_OP_CMP_GE 5 /* if (oldval E<gt>= cmparg) wake */\n"
2845 msgstr ""
2846 "FUTEX_OP_CMP_EQ 0 /* si (oldval == cmparg) réveiller */\n"
2847 "FUTEX_OP_CMP_NE 1 /* si (oldval != cmparg) réveiller */\n"
2848 "FUTEX_OP_CMP_LT 2 /* si (oldval E<lt> cmparg) réveiller */\n"
2849 "FUTEX_OP_CMP_LE 3 /* si (oldval E<lt>= cmparg) réveiller */\n"
2850 "FUTEX_OP_CMP_GT 4 /* si (oldval E<gt> cmparg) réveiller */\n"
2851 "FUTEX_OP_CMP_GE 5 /* si (oldval E<gt>= cmparg) réveiller */\n"
2852
2853 #
2854 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2855 #. type: Plain text
2856 #: debian-trixie fedora-44 fedora-rawhide
2857 msgid ""
2858 "The return value of B<FUTEX_WAKE_OP> is the sum of the number of waiters "
2859 "woken on the futex I<uaddr> plus the number of waiters woken on the futex "
2860 "I<uaddr2>."
2861 msgstr ""
2862 "Le code de retour de B<FUTEX_WAKE_OP> est la somme du nombre d'éléments en "
2863 "attente réveillés par le futex I<uaddr> et du nombre d'éléments en attente "
2864 "réveillés sur le futex I<uaddr2>."
2865
2866 #. type: TP
2867 #: debian-trixie fedora-44 fedora-rawhide
2868 #, no-wrap
2869 msgid "B<FUTEX_WAIT_BITSET> (since Linux 2.6.25)"
2870 msgstr "B<FUTEX_WAIT_BITSET> (depuis Linux 2.6.25)"
2871
2872 #. commit cd689985cf49f6ff5c8eddc48d98b9d581d9475d
2873 #. type: Plain text
2874 #: debian-trixie fedora-44 fedora-rawhide
2875 msgid ""
2876 "This operation is like B<FUTEX_WAIT> except that I<val3> is used to provide "
2877 "a 32-bit bit mask to the kernel. This bit mask, in which at least one bit "
2878 "must be set, is stored in the kernel-internal state of the waiter. See the "
2879 "description of B<FUTEX_WAKE_BITSET> for further details."
2880 msgstr ""
2881 "Cette opération est équivalente à B<FUTEX_WAIT>, sauf que I<val3> est "
2882 "utilisé pour fournir un masque de bit de 32 bits au noyau. Ce masque, où au "
2883 "moins un bit doit être positionné, est stocké dans la partie interne du "
2884 "noyau de l'élément en attente. Voir la description de B<FUTEX_WAKE_BITSET> "
2885 "pour plus de détails."
2886
2887 #. type: Plain text
2888 #: debian-trixie fedora-44 fedora-rawhide
2889 msgid ""
2890 "If I<timeout> is not NULL, the structure it points to specifies an absolute "
2891 "timeout for the wait operation. If I<timeout> is NULL, the operation can "
2892 "block indefinitely."
2893 msgstr ""
2894 "Si I<timeout> n'est pas NULL, la structure vers laquelle il pointe indique "
2895 "un délai absolu de l'opération d'attente. Si I<timeout> est NULL, "
2896 "l'opération peut se bloquer indéfiniment."
2897
2898 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2899 #. type: Plain text
2900 #: debian-trixie fedora-44 fedora-rawhide
2901 msgid "The I<uaddr2> argument is ignored."
2902 msgstr "L'argument I<uaddr2> est ignoré."
2903
2904 #. type: TP
2905 #: debian-trixie fedora-44 fedora-rawhide
2906 #, no-wrap
2907 msgid "B<FUTEX_WAKE_BITSET> (since Linux 2.6.25)"
2908 msgstr "B<FUTEX_WAKE_BITSET> (depuis Linux 2.6.25)"
2909
2910 #. commit cd689985cf49f6ff5c8eddc48d98b9d581d9475d
2911 #. type: Plain text
2912 #: debian-trixie fedora-44 fedora-rawhide
2913 msgid ""
2914 "This operation is the same as B<FUTEX_WAKE> except that the I<val3> argument "
2915 "is used to provide a 32-bit bit mask to the kernel. This bit mask, in which "
2916 "at least one bit must be set, is used to select which waiters should be "
2917 "woken up. The selection is done by a bitwise AND of the \"wake\" bit mask "
2918 "(i.e., the value in I<val3>) and the bit mask which is stored in the kernel-"
2919 "internal state of the waiter (the \"wait\" bit mask that is set using "
2920 "B<FUTEX_WAIT_BITSET>). All of the waiters for which the result of the AND "
2921 "is nonzero are woken up; the remaining waiters are left sleeping."
2922 msgstr ""
2923 "Cette opération est identique à B<FUTEX_WAKE>, sauf que le paramètre I<val3> "
2924 "est utilisé pour fournir un masque de bit de 32 bits au noyau. Ce masque, où "
2925 "au moins un bit doit être positionné, est utilisé pour choisir les éléments "
2926 "en attente qui doivent être réveillés. Le choix se fait par une comparaison "
2927 "bit à bit AND du masque de bit « wait » (à savoir la valeur de I<val3>) et "
2928 "par un masque de bit stocké dans la partie interne de l'élément en attente "
2929 "(le masque de bit « wait » positionné en utilisant B<FUTEX_WAIT_BITSET>). "
2930 "Tous les éléments en attente pour lesquels le AND est positif sont "
2931 "réveillés ; les autres restent endormis."
2932
2933 #
2934 #
2935 #. According to http://locklessinc.com/articles/futex_cheat_sheet/:
2936 #. "The original reason for the addition of these extensions
2937 #. was to improve the performance of pthread read-write locks
2938 #. in glibc. However, the pthreads library no longer uses the
2939 #. same locking algorithm, and these extensions are not used
2940 #. without the bitset parameter being all ones.
2941 #. The page goes on to note that the FUTEX_WAIT_BITSET operation
2942 #. is nevertheless used (with a bit mask of all ones) in order to
2943 #. obtain the absolute timeout functionality that is useful
2944 #. for efficiently implementing Pthreads APIs (which use absolute
2945 #. timeouts); FUTEX_WAIT provides only relative timeouts.
2946 #. type: Plain text
2947 #: debian-trixie fedora-44 fedora-rawhide
2948 msgid ""
2949 "The effect of B<FUTEX_WAIT_BITSET> and B<FUTEX_WAKE_BITSET> is to allow "
2950 "selective wake-ups among multiple waiters that are blocked on the same "
2951 "futex. However, note that, depending on the use case, employing this bit-"
2952 "mask multiplexing feature on a futex can be less efficient than simply using "
2953 "multiple futexes, because employing bit-mask multiplexing requires the "
2954 "kernel to check all waiters on a futex, including those that are not "
2955 "interested in being woken up (i.e., they do not have the relevant bit set in "
2956 "their \"wait\" bit mask)."
2957 msgstr ""
2958 "L'effet de B<FUTEX_WAIT_BITSET> et de B<FUTEX_WAKE_BITSET> est de permettre "
2959 "un réveil sélectif parmi les éléments en attente bloqués sur le même futex. "
2960 "Cependant, remarquez que selon le cas, l'utilisation de cette fonction de "
2961 "mélange de masques de bit sur un futex peut être moins efficace que le fait "
2962 "d'avoir plusieurs futex, car elle a besoin que le noyau vérifie tous les "
2963 "éléments en attente sur un futex, y compris ceux non concernés par le réveil "
2964 "(à savoir qu'ils n'ont pas de bit pertinent positionné dans leur masque de "
2965 "bit « wait »)."
2966
2967 #. type: Plain text
2968 #: debian-trixie fedora-44 fedora-rawhide
2969 msgid ""
2970 "The constant B<FUTEX_BITSET_MATCH_ANY>, which corresponds to all 32 bits set "
2971 "in the bit mask, can be used as the I<val3> argument for "
2972 "B<FUTEX_WAIT_BITSET> and B<FUTEX_WAKE_BITSET>. Other than differences in "
2973 "the handling of the I<timeout> argument, the B<FUTEX_WAIT> operation is "
2974 "equivalent to B<FUTEX_WAIT_BITSET> with I<val3> specified as "
2975 "B<FUTEX_BITSET_MATCH_ANY>; that is, allow a wake-up by any waker. The "
2976 "B<FUTEX_WAKE> operation is equivalent to B<FUTEX_WAKE_BITSET> with I<val3> "
2977 "specified as B<FUTEX_BITSET_MATCH_ANY>; that is, wake up any waiter(s)."
2978 msgstr ""
2979 "La constante B<FUTEX_BITSET_MATCH_ANY>, qui correspond à tous les "
2980 "positionnements 32 bits du masque, peut être utilisé en tant que I<val3> de "
2981 "B<FUTEX_WAIT_BITSET> et de B<FUTEX_WAKE_BITSET>. En dehors des différences "
2982 "dans la gestion du paramètre I<timeout>, l'opération B<FUTEX_WAIT> est "
2983 "équivalente à B<FUTEX_WAIT_BITSET> où I<val3> est indiqué en tant que "
2984 "B<FUTEX_BITSET_MATCH_ANY> ; c'est-à-dire permettre le réveil par n'importe "
2985 "quel élément en attente). L’opération B<FUTEX_WAKE> est équivalente à "
2986 "B<FUTEX_WAKE_BITSET> où I<val3> est indiqué en tant que "
2987 "B<FUTEX_BITSET_MATCH_ANY> ; c'est-à-dire, réveiller n’importe quel élément "
2988 "en attente."
2989
2990 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2991 #. type: Plain text
2992 #: debian-trixie fedora-44 fedora-rawhide
2993 msgid "The I<uaddr2> and I<timeout> arguments are ignored."
2994 msgstr "Les arguments I<uaddr2> et I<timeout> sont ignorés."
2995
2996 #. type: Plain text
2997 #: debian-trixie fedora-44 fedora-rawhide
2998 msgid ""
2999 "If a futex is already acquired (i.e., has a nonzero value), waiters must "
3000 "employ the B<FUTEX_LOCK_PI> or B<FUTEX_LOCK_PI2> operations to acquire the "
3001 "lock. If other threads are waiting for the lock, then the B<FUTEX_WAITERS> "
3002 "bit is set in the futex value; in this case, the lock owner must employ the "
3003 "B<FUTEX_UNLOCK_PI> operation to release the lock."
3004 msgstr ""
3005 "Si un futex est déjà acquis (c'est-à-dire qu'il a une valeur positive), les "
3006 "éléments en attente doivent utiliser l'opération B<FUTEX_LOCK_PI> pour "
3007 "acquérir le verrou. Si d'autres threads attendent le verrou, le bit "
3008 "B<FUTEX_WAITERS> est défini dans la valeur du futex ; dans ce cas le "
3009 "détenteur du verrou doit utiliser l'opération B<FUTEX_UNLOCK_PI> pour "
3010 "relâcher le verrou."
3011
3012 #. type: Plain text
3013 #: debian-trixie fedora-44 fedora-rawhide
3014 msgid ""
3015 "PI futexes are operated on by specifying one of the values listed below in "
3016 "I<futex_op>. Note that the PI futex operations must be used as paired "
3017 "operations and are subject to some additional requirements:"
3018 msgstr ""
3019 "Les PI futex sont utilisés en indiquant une des valeurs listées ci-dessous "
3020 "dans I<futex_op>. Remarquez que les opérations de PI futex doivent être "
3021 "utilisées par paires et sont soumises à des exigences supplémentaires :"
3022
3023 #. type: Plain text
3024 #: debian-trixie fedora-44 fedora-rawhide
3025 msgid ""
3026 "B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, and B<FUTEX_TRYLOCK_PI> pair with "
3027 "B<FUTEX_UNLOCK_PI>. B<FUTEX_UNLOCK_PI> must be called only on a futex owned "
3028 "by the calling thread, as defined by the value policy, otherwise the error "
3029 "B<EPERM> results."
3030 msgstr ""
3031 "B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2> et B<FUTEX_TRYLOCK_PI> vont de pair avec "
3032 "B<FUTEX_UNLOCK_PI>. B<FUTEX_UNLOCK_PI> ne doit être appelé que sur un futex "
3033 "appartenant au thread appelant, tel que défini par les règles de la valeur, "
3034 "sans quoi on obtient l'erreur B<EPERM>."
3035
3036 #. type: Plain text
3037 #: debian-trixie fedora-44 fedora-rawhide
3038 msgid ""
3039 "B<FUTEX_WAIT_REQUEUE_PI> pairs with B<FUTEX_CMP_REQUEUE_PI>. This must be "
3040 "performed from a non-PI futex to a distinct PI futex (or the error B<EINVAL> "
3041 "results). Additionally, I<val> (the number of waiters to be woken) must be "
3042 "1 (or the error B<EINVAL> results)."
3043 msgstr ""
3044 "B<FUTEX_WAIT_REQUEUE_PI> va de pair avec B<FUTEX_CMP_REQUEUE_PI>. Elles "
3045 "doivent s'effectuer depuis un futex non-PI vers un PI futex distinct (sans "
3046 "quoi on obtient l'erreur B<EINVAL>). De plus, I<val> (le nombre d'éléments "
3047 "en attente à réveiller) doit être de B<1> (sans quoi on obtient l'erreur "
3048 "B<EINVAL>)."
3049
3050 #. type: TP
3051 #: debian-trixie fedora-44 fedora-rawhide
3052 #, no-wrap
3053 msgid "B<FUTEX_LOCK_PI> (since Linux 2.6.18)"
3054 msgstr "B<FUTEX_LOCK_PI> (depuis Linux 2.6.18)"
3055
3056 #. commit c87e2837be82df479a6bae9f155c43516d2feebc
3057 #. type: Plain text
3058 #: debian-trixie fedora-44 fedora-rawhide
3059 msgid ""
3060 "This operation is used after an attempt to acquire the lock via an atomic "
3061 "user-mode instruction failed because the futex word has a nonzero value\\"
3062 "[em]specifically, because it contained the (PID-namespace-specific) TID of "
3063 "the lock owner."
3064 msgstr ""
3065 "Cette opération est utilisée après avoir essayé sans succès d'acquérir un "
3066 "verrou en utilisant une instruction atomique en mode utilisateur, car le mot "
3067 "futex a une valeur positive – en particulier parce qu'il contenait le TID "
3068 "(spécifique à l’espace de noms PID) du verrou propriétaire."
3069
3070 #
3071 #
3072 #
3073 #. tglx (July 2015):
3074 #. The operation here is similar to the FUTEX_WAIT logic. When the user
3075 #. space atomic acquire does not succeed because the futex value was non
3076 #. zero, then the waiter goes into the kernel, takes the kernel internal
3077 #. lock and retries the acquisition under the lock. If the acquisition
3078 #. does not succeed either, then it sets the FUTEX_WAITERS bit, to signal
3079 #. the lock owner that it needs to go into the kernel. Here is the pseudo
3080 #. code:
3081 #. lock(kernel_lock);
3082 #. retry:
3083 #. /*
3084 #. * Owner might have unlocked in user space before we
3085 #. * were able to set the waiter bit.
3086 #. */
3087 #. if (atomic_acquire(futex) == SUCCESS) {
3088 #. unlock(kernel_lock());
3089 #. return 0;
3090 #. }
3091 #. /*
3092 #. * Owner might have unlocked after the above atomic_acquire()
3093 #. * attempt.
3094 #. */
3095 #. if (atomic_set_waiters_bit(futex) != SUCCESS)
3096 #. goto retry;
3097 #. queue_waiter();
3098 #. unlock(kernel_lock);
3099 #. block();
3100 #. type: Plain text
3101 #: debian-trixie fedora-44 fedora-rawhide
3102 msgid ""
3103 "The operation checks the value of the futex word at the address I<uaddr>. "
3104 "If the value is 0, then the kernel tries to atomically set the futex value "
3105 "to the caller's TID. If the futex word's value is nonzero, the kernel "
3106 "atomically sets the B<FUTEX_WAITERS> bit, which signals the futex owner that "
3107 "it cannot unlock the futex in user space atomically by setting the futex "
3108 "value to 0. After that, the kernel:"
3109 msgstr ""
3110 "L'opération vérifie la valeur du mot futex sur l'adresse I<uaddr>. Si la "
3111 "valeur est de B<0>, le noyau essaie de positionner de manière atomique la "
3112 "valeur du futex sur le TID de l'appelant. Si la valeur du mot futex est "
3113 "positive, le noyau positionne de manière atomique le bit B<FUTEX_WAITERS>, "
3114 "qui signale au propriétaire du futex qu'il ne peut pas déverrouiller le "
3115 "futex dans l'espace utilisateur de manière atomique, en positionnant la "
3116 "valeur du futex à B<0>. Après cela, le noyau :"
3117
3118 #. type: IP
3119 #: debian-trixie fedora-44 fedora-rawhide
3120 #, no-wrap
3121 msgid "(1)"
3122 msgstr "(1)"
3123
3124 #. type: Plain text
3125 #: debian-trixie fedora-44 fedora-rawhide
3126 msgid "Tries to find the thread which is associated with the owner TID."
3127 msgstr "Essaie de trouver le thread associé au TID du propriétaire."
3128
3129 #. type: IP
3130 #: debian-trixie fedora-44 fedora-rawhide
3131 #, no-wrap
3132 msgid "(2)"
3133 msgstr "(2)"
3134
3135 #. type: Plain text
3136 #: debian-trixie fedora-44 fedora-rawhide
3137 msgid ""
3138 "Creates or reuses kernel state on behalf of the owner. (If this is the "
3139 "first waiter, there is no kernel state for this futex, so kernel state is "
3140 "created by locking the RT-mutex and the futex owner is made the owner of the "
3141 "RT-mutex. If there are existing waiters, then the existing state is reused.)"
3142 msgstr ""
3143 "Crée ou réutilise l'état du noyau sur la base du propriétaire (s'il s'agit "
3144 "du premier élément en attente, il n'existe pas d'état du noyau pour ce "
3145 "futex, donc il est créé en verrouillant le RT-mutex et le propriétaire du "
3146 "futex devient propriétaire du RT-mutex). Si des éléments en attente "
3147 "existent, l'état existant est réutilisé."
3148
3149 #. type: IP
3150 #: debian-trixie fedora-44 fedora-rawhide
3151 #, no-wrap
3152 msgid "(3)"
3153 msgstr "(3)"
3154
3155 #. type: Plain text
3156 #: debian-trixie fedora-44 fedora-rawhide
3157 msgid ""
3158 "Attaches the waiter to the futex (i.e., the waiter is enqueued on the RT-"
3159 "mutex waiter list)."
3160 msgstr ""
3161 "Rattache l'élément en attente au futex (c'est-à-dire que l'élément est mis "
3162 "dans la file d'attente du RT-futex)."
3163
3164 #
3165 #. August 2015:
3166 #. mtk: If the realm is restricted purely to SCHED_OTHER (SCHED_NORMAL)
3167 #. processes, does the nice value come into play also?
3168 #. tglx: No. SCHED_OTHER/NORMAL tasks are handled in FIFO order
3169 #. (i.e., task 1 blocks on lock A, held by task 2,
3170 #. while task 2 blocks on lock B, held by task 3)
3171 #. type: Plain text
3172 #: debian-trixie fedora-44 fedora-rawhide
3173 msgid ""
3174 "If more than one waiter exists, the enqueueing of the waiter is in "
3175 "descending priority order. (For information on priority ordering, see the "
3176 "discussion of the B<SCHED_DEADLINE>, B<SCHED_FIFO>, and B<SCHED_RR> "
3177 "scheduling policies in B<sched>(7).) The owner inherits either the waiter's "
3178 "CPU bandwidth (if the waiter is scheduled under the B<SCHED_DEADLINE> "
3179 "policy) or the waiter's priority (if the waiter is scheduled under the "
3180 "B<SCHED_RR> or B<SCHED_FIFO> policy). This inheritance follows the lock "
3181 "chain in the case of nested locking and performs deadlock detection."
3182 msgstr ""
3183 "S'il existe plus d'un élément en attente, la mise dans la file d'un élément "
3184 "se fait par ordre de priorité descendant (pour des informations sur l'ordre "
3185 "des priorités, voir les points sur l'ordonnancement B<SCHED_DEADLINE>, "
3186 "B<SCHED_FIFO> et B<SCHED_RR> dans B<sched>(7)). Le propriétaire hérite soit "
3187 "de la bande passante de processeur de l'élément en attente (si l'élément est "
3188 "programmé sous la règle B<SCHED_DEADLINE> ou B<SCHED_FIFO>), soit de la "
3189 "priorité de l'élément en attente (s'il est programmé sous la règle "
3190 "B<SCHED_RR> ou B<SCHED_FIFO>). Cet héritage suit la chaîne de verrous dans "
3191 "les cas de verrous imbriqués et il effectue la détection des verrous morts "
3192 "(deadlocks)."
3193
3194 #
3195 #
3196 #. 2016-07-07 response from Thomas Gleixner on LKML:
3197 #. From: Thomas Gleixner <[email protected]>
3198 #. Date: 6 July 2016 at 20:57
3199 #. Subject: Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op
3200 #. On Thu, 23 Jun 2016, Michael Kerrisk (man-pages) wrote:
3201 #. > On 06/23/2016 08:28 PM, Darren Hart wrote:
3202 #. > > And as a follow-on, what is the reason for FUTEX_LOCK_PI only using
3203 #. > > CLOCK_REALTIME? It seems reasonable to me that a user may want to wait a
3204 #. > > specific amount of time, regardless of wall time.
3205 #. >
3206 #. > Yes, that's another weird inconsistency.
3207 #. The reason is that phtread_mutex_timedlock() uses absolute timeouts based on
3208 #. CLOCK_REALTIME. glibc folks asked to make that the default behaviour back
3209 #. then when we added LOCK_PI.
3210 #. type: Plain text
3211 #: debian-trixie fedora-44 fedora-rawhide
3212 msgid ""
3213 "The I<timeout> argument provides a timeout for the lock attempt. If "
3214 "I<timeout> is not NULL, the structure it points to specifies an absolute "
3215 "timeout, measured against the B<CLOCK_REALTIME> clock. If I<timeout> is "
3216 "NULL, the operation will block indefinitely."
3217 msgstr ""
3218 "Le paramètre I<timeout> fournit un délai de tentative de verrouillage. Si "
3219 "I<timeout> est positif, la structure vers laquelle il pointe indique un "
3220 "délai absolu mesuré en fonction de l'horloge B<CLOCK_REALTIME>. Si "
3221 "I<timeout> est NULL, l'opération se bloquera indéfiniment."
3222
3223 #
3224 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3225 #. type: Plain text
3226 #: debian-trixie fedora-44 fedora-rawhide
3227 msgid "The I<uaddr2>, I<val>, and I<val3> arguments are ignored."
3228 msgstr "Les paramètres I<uaddr2>, I<val> et I<val3> sont ignorés."
3229
3230 #. type: TP
3231 #: debian-trixie fedora-44 fedora-rawhide
3232 #, no-wrap
3233 msgid "B<FUTEX_LOCK_PI2> (since Linux 5.14)"
3234 msgstr "B<FUTEX_LOCK_PI2> (depuis Linux 5.14)"
3235
3236 #
3237 #. commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
3238 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3239 #. type: Plain text
3240 #: debian-trixie fedora-44 fedora-rawhide
3241 msgid ""
3242 "This operation is the same as B<FUTEX_LOCK_PI>, except that the clock "
3243 "against which I<timeout> is measured is selectable. By default, the "
3244 "(absolute) timeout specified in I<timeout> is measured against the "
3245 "B<CLOCK_MONOTONIC> clock, but if the B<FUTEX_CLOCK_REALTIME> flag is "
3246 "specified in I<futex_op>, then the timeout is measured against the "
3247 "B<CLOCK_REALTIME> clock."
3248 msgstr ""
3249 "Cette opération est la même que B<FUTEX_LOCK_PI>, sauf que l'horloge par "
3250 "rapport à laquelle I<timeout> est mesuré peut être sélectionnée. Par défaut, "
3251 "le délai (absolu) indiqué dans I<timeout> est mesuré par rapport à l'horloge "
3252 "B<CLOCK_MONOTONIC> mais si l'attribut B<FUTEX_CLOCK_REALTIME> est indiqué "
3253 "dans I<futex_op>, le délai est mesuré par rapport à l'horloge "
3254 "B<CLOCK_REALTIME>."
3255
3256 #. type: TP
3257 #: debian-trixie fedora-44 fedora-rawhide
3258 #, no-wrap
3259 msgid "B<FUTEX_TRYLOCK_PI> (since Linux 2.6.18)"
3260 msgstr "B<FUTEX_TRYLOCK_PI> (depuis Linux 2.6.18)"
3261
3262 #. commit c87e2837be82df479a6bae9f155c43516d2feebc
3263 #. type: Plain text
3264 #: debian-trixie fedora-44 fedora-rawhide
3265 msgid ""
3266 "This operation tries to acquire the lock at I<uaddr>. It is invoked when a "
3267 "user-space atomic acquire did not succeed because the futex word was not 0."
3268 msgstr ""
3269 "L'opération essaie d'acquérir le verrou sur I<uaddr>. Elle est appelée quand "
3270 "l'acquisition atomique dans l'espace utilisateur n'a pas réussi parce que le "
3271 "mot futex ne valait pas B<0>."
3272
3273 #. Paraphrasing a f2f conversation with Thomas Gleixner about the
3274 #. above point (Aug 2015): ###
3275 #. There is a rare possibility of a race condition involving an
3276 #. uncontended futex with no owner, but with waiters. The
3277 #. kernel-user-space contract is that if a futex is nonzero, you must
3278 #. go into kernel. The futex was owned by a task, and that task dies
3279 #. but there are no waiters, so the futex value is non zero.
3280 #. Therefore, the next locker has to go into the kernel,
3281 #. so that the kernel has a chance to clean up. (CMXCH on zero
3282 #. in user space would fail, so kernel has to clean up.)
3283 #. Darren Hart (Oct 2015):
3284 #. The trylock in the kernel has more state, so it can independently
3285 #. verify the flags that user space must trust implicitly.
3286 #. type: Plain text
3287 #: debian-trixie fedora-44 fedora-rawhide
3288 msgid ""
3289 "Because the kernel has access to more state information than user space, "
3290 "acquisition of the lock might succeed if performed by the kernel in cases "
3291 "where the futex word (i.e., the state information accessible to use-space) "
3292 "contains stale state (B<FUTEX_WAITERS> and/or B<FUTEX_OWNER_DIED>). This "
3293 "can happen when the owner of the futex died. User space cannot handle this "
3294 "condition in a race-free manner, but the kernel can fix this up and acquire "
3295 "the futex."
3296 msgstr ""
3297 "Du fait que le noyau accède à plus d'informations d'état que l'espace "
3298 "utilisateur, l'acquisition du verrou pourrait réussir si elle est effectuée "
3299 "par le noyau dans les cas où le mot futex (c'est-à-dire les informations "
3300 "d'état accessibles dans l'espace utilisateur) contient un état stable "
3301 "(B<FUTEX_WAITERS> et/ou B<FUTEX_OWNER_DIED>). Cela peut arriver quand le "
3302 "propriétaire du futex est mort. L'espace utilisateur ne peut pas gérer cette "
3303 "condition de manière \"race-free\", mais le noyau peut corriger cela et "
3304 "acquérir le futex."
3305
3306 #
3307 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3308 #. type: Plain text
3309 #: debian-trixie fedora-44 fedora-rawhide
3310 msgid "The I<uaddr2>, I<val>, I<timeout>, and I<val3> arguments are ignored."
3311 msgstr "Les paramètres I<uaddr2>, I<val>, I<timeout> et I<val3> sont ignorés."
3312
3313 #. type: TP
3314 #: debian-trixie fedora-44 fedora-rawhide
3315 #, no-wrap
3316 msgid "B<FUTEX_UNLOCK_PI> (since Linux 2.6.18)"
3317 msgstr "B<FUTEX_UNLOCK_PI> (depuis Linux 2.6.18)"
3318
3319 #. commit c87e2837be82df479a6bae9f155c43516d2feebc
3320 #. type: Plain text
3321 #: debian-trixie fedora-44 fedora-rawhide
3322 msgid ""
3323 "This operation wakes the top priority waiter that is waiting in "
3324 "B<FUTEX_LOCK_PI> or B<FUTEX_LOCK_PI2> on the futex address provided by the "
3325 "I<uaddr> argument."
3326 msgstr ""
3327 "Cette opération réveille l'élément ayant la plus haute priorité et attendant "
3328 "un B<FUTEX_LOCK_PI> ou un B<FUTEX_LOCK_PI2> à l'adresse indiquée par le "
3329 "paramètre I<uaddr>."
3330
3331 #. type: Plain text
3332 #: debian-trixie fedora-44 fedora-rawhide
3333 msgid ""
3334 "This is called when the user-space value at I<uaddr> cannot be changed "
3335 "atomically from a TID (of the owner) to 0."
3336 msgstr ""
3337 "Cela est appelé quand la valeur dans l'espace utilisateur sur I<uaddr> ne "
3338 "peut pas être passée à B<0> de manière atomique depuis un TID (du "
3339 "propriétaire)."
3340
3341 #. type: TP
3342 #: debian-trixie fedora-44 fedora-rawhide
3343 #, no-wrap
3344 msgid "B<FUTEX_CMP_REQUEUE_PI> (since Linux 2.6.31)"
3345 msgstr "B<FUTEX_CMP_REQUEUE_PI> (depuis Linux 2.6.31)"
3346
3347 #. commit 52400ba946759af28442dee6265c5c0180ac7122
3348 #. type: Plain text
3349 #: debian-trixie fedora-44 fedora-rawhide
3350 msgid ""
3351 "This operation is a PI-aware variant of B<FUTEX_CMP_REQUEUE>. It requeues "
3352 "waiters that are blocked via B<FUTEX_WAIT_REQUEUE_PI> on I<uaddr> from a non-"
3353 "PI source futex (I<uaddr>) to a PI target futex (I<uaddr2>)."
3354 msgstr ""
3355 "Cette opération est une variante PI-aware de B<FUTEX_CMP_REQUEUE>. Elle "
3356 "remet en attente des éléments bloqués avec B<FUTEX_WAIT_REQUEUE_PI> sur "
3357 "I<uaddr> à partir d'un futex source non-PI (I<uaddr>) vers un futex cible PI "
3358 "(I<uaddr2>)."
3359
3360 #. type: Plain text
3361 #: debian-trixie fedora-44 fedora-rawhide
3362 msgid ""
3363 "As with B<FUTEX_CMP_REQUEUE>, this operation wakes up a maximum of I<val> "
3364 "waiters that are waiting on the futex at I<uaddr>. However, for "
3365 "B<FUTEX_CMP_REQUEUE_PI>, I<val> is required to be 1 (since the main point is "
3366 "to avoid a thundering herd). The remaining waiters are removed from the "
3367 "wait queue of the source futex at I<uaddr> and added to the wait queue of "
3368 "the target futex at I<uaddr2>."
3369 msgstr ""
3370 "Comme avec B<FUTEX_CMP_REQUEUE>, cette opération réveille un maximum de "
3371 "I<val> éléments qui attendent le futex sur I<uaddr>. Toutefois, pour "
3372 "B<FUTEX_CMP_REQUEUE_PI>, I<val> doit valoir B<1> (puisque son but principal "
3373 "est d'éviter l’effet de troupeau (thundering herd). Les autres éléments sont "
3374 "supprimés de la file d'attente du futex source sur I<uaddr> et ajoutés sur "
3375 "celle du futex cible sur I<uaddr2>."
3376
3377 #
3378 #
3379 #. val2 is the cap on the number of requeued waiters.
3380 #. In the glibc pthread_cond_broadcast() implementation, this argument
3381 #. is specified as INT_MAX, and for pthread_cond_signal() it is 0.
3382 #. The page at http://locklessinc.com/articles/futex_cheat_sheet/
3383 #. notes that "priority-inheritance Futex to priority-inheritance
3384 #. Futex requeues are currently unsupported". However, probably
3385 #. the page does not need to say nothing about this, since
3386 #. Thomas Gleixner commented (July 2015): "they never will be
3387 #. supported because they make no sense at all"
3388 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3389 #. type: Plain text
3390 #: debian-trixie fedora-44 fedora-rawhide
3391 msgid ""
3392 "The I<val2> and I<val3> arguments serve the same purposes as for "
3393 "B<FUTEX_CMP_REQUEUE>."
3394 msgstr ""
3395 "Les paramètres I<val2> et I<val3> ont le même objectif qu'avec "
3396 "B<FUTEX_CMP_REQUEUE>."
3397
3398 #. type: TP
3399 #: debian-trixie fedora-44 fedora-rawhide
3400 #, no-wrap
3401 msgid "B<FUTEX_WAIT_REQUEUE_PI> (since Linux 2.6.31)"
3402 msgstr "B<FUTEX_WAIT_REQUEUE_PI> (depuis Linux 2.6.31)"
3403
3404 #. commit 52400ba946759af28442dee6265c5c0180ac7122
3405 #. type: Plain text
3406 #: debian-trixie fedora-44 fedora-rawhide
3407 msgid ""
3408 "Wait on a non-PI futex at I<uaddr> and potentially be requeued (via a "
3409 "B<FUTEX_CMP_REQUEUE_PI> operation in another task) onto a PI futex at "
3410 "I<uaddr2>. The wait operation on I<uaddr> is the same as for B<FUTEX_WAIT>."
3411 msgstr ""
3412 "Attendre un futex non-PI sur I<uaddr> et se mettre potentiellement en "
3413 "attente (avec une opération B<FUTEX_CMP_REQUEUE_PI> dans une autre tâche), "
3414 "d'un futex PI sur I<uaddr2>. L'opération d'attente sur I<uaddr> est la même "
3415 "que pour B<FUTEX_WAIT>."
3416
3417 #. type: Plain text
3418 #: debian-trixie fedora-44 fedora-rawhide
3419 msgid ""
3420 "The waiter can be removed from the wait on I<uaddr> without requeueing on "
3421 "I<uaddr2> via a B<FUTEX_WAKE> operation in another task. In this case, the "
3422 "B<FUTEX_WAIT_REQUEUE_PI> operation fails with the error B<EAGAIN>."
3423 msgstr ""
3424 "L'élément peut être retiré de la file d'attente sur I<uaddr> sans être "
3425 "transféré sur I<uaddr2> à l’aide d’une opération B<FUTEX_WAKE> dans une "
3426 "autre tâche. Dans ce cas, l'opération B<FUTEX_WAIT_REQUEUE_PI> échoue avec "
3427 "l'erreur B<EAGAIN>."
3428
3429 #. type: Plain text
3430 #: debian-trixie fedora-44 fedora-rawhide
3431 msgid "The I<val3> argument is ignored."
3432 msgstr "L'argument I<val3> est ignoré."
3433
3434 #
3435 #
3436 #
3437 #
3438 #
3439 #. Darren Hart notes that a patch to allow glibc to fully support
3440 #. PI-aware pthreads condition variables has not yet been accepted into
3441 #. glibc. The story is complex, and can be found at
3442 #. https://sourceware.org/bugzilla/show_bug.cgi?id=11588
3443 #. Darren notes that in the meantime, the patch is shipped with various
3444 #. PREEMPT_RT-enabled Linux systems.
3445 #. Related to the preceding, Darren proposed that somewhere, man-pages
3446 #. should document the following point:
3447 #. While the Linux kernel, since Linux 2.6.31, supports requeueing of
3448 #. priority-inheritance (PI) aware mutexes via the
3449 #. FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI futex operations,
3450 #. the glibc implementation does not yet take full advantage of this.
3451 #. Specifically, the condvar internal data lock remains a non-PI aware
3452 #. mutex, regardless of the type of the pthread_mutex associated with
3453 #. the condvar. This can lead to an unbounded priority inversion on
3454 #. the internal data lock even when associating a PI aware
3455 #. pthread_mutex with a condvar during a pthread_cond*_wait
3456 #. operation. For this reason, it is not recommended to rely on
3457 #. priority inheritance when using pthread condition variables.
3458 #. The problem is that the obvious location for this text is
3459 #. the pthread_cond*wait(3) man page. However, such a man page
3460 #. does not currently exist.
3461 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3462 #. type: Plain text
3463 #: debian-trixie fedora-44 fedora-rawhide
3464 msgid ""
3465 "The B<FUTEX_WAIT_REQUEUE_PI> and B<FUTEX_CMP_REQUEUE_PI> were added to "
3466 "support a fairly specific use case: support for priority-inheritance-aware "
3467 "POSIX threads condition variables. The idea is that these operations should "
3468 "always be paired, in order to ensure that user space and the kernel remain "
3469 "in sync. Thus, in the B<FUTEX_WAIT_REQUEUE_PI> operation, the user-space "
3470 "application pre-specifies the target of the requeue that takes place in the "
3471 "B<FUTEX_CMP_REQUEUE_PI> operation."
3472 msgstr ""
3473 "B<FUTEX_WAIT_REQUEUE_PI> et B<FUTEX_CMP_REQUEUE_PI> ont été ajoutés pour "
3474 "gérer un cas d'utilisation bien particulier : la prise en charge des "
3475 "variables conditionnelles de threads POSIX ayant connaissance de l'héritage "
3476 "de priorité. L'idée est que ces opérations devraient toujours aller par "
3477 "paires, afin de garantir que l'espace utilisateur et le noyau restent "
3478 "toujours synchronisés. Ainsi, dans l'opération B<FUTEX_WAIT_REQUEUE_PI>, "
3479 "l'application dans l'espace utilisateur pré-indique la cible de la remise en "
3480 "attente qui va se faire dans l'opération B<FUTEX_CMP_REQUEUE_PI>."
3481
3482 #. type: Plain text
3483 #: debian-trixie fedora-44 fedora-rawhide
3484 msgid ""
3485 "In the event of an error (and assuming that B<futex>() was invoked via "
3486 "B<syscall>(2)), all operations return -1 and set I<errno> to indicate the "
3487 "error."
3488 msgstr ""
3489 "En cas d'erreur (en supposant que B<futex>() a été appelé à l’aide de "
3490 "B<syscall>(2)), toutes les opérations renvoient B<-1> et positionnent "
3491 "I<errno> pour indiquer l'erreur."
3492
3493 #. type: Plain text
3494 #: debian-trixie fedora-44 fedora-rawhide
3495 msgid ""
3496 "The return value on success depends on the operation, as described in the "
3497 "following list:"
3498 msgstr ""
3499 "En cas de succès, le code de retour dépend de l'opération, comme décrit dans "
3500 "la liste suivante :"
3501
3502 #. type: TP
3503 #: debian-trixie fedora-44 fedora-rawhide
3504 #, no-wrap
3505 msgid "B<FUTEX_WAIT>"
3506 msgstr "B<FUTEX_WAIT>"
3507
3508 #. type: Plain text
3509 #: debian-trixie fedora-44 fedora-rawhide
3510 msgid ""
3511 "Returns 0 if the caller was woken up. Note that a wake-up can also be "
3512 "caused by common futex usage patterns in unrelated code that happened to "
3513 "have previously used the futex word's memory location (e.g., typical futex-"
3514 "based implementations of Pthreads mutexes can cause this under some "
3515 "conditions). Therefore, callers should always conservatively assume that a "
3516 "return value of 0 can mean a spurious wake-up, and use the futex word's "
3517 "value (i.e., the user-space synchronization scheme) to decide whether to "
3518 "continue to block or not."
3519 msgstr ""
3520 "Renvoie B<0> si l'appelant a été réveillé. Remarquez qu'un réveil peut "
3521 "également résulter de l'utilisation de motifs d'utilisation classiques de "
3522 "futex dans du code non lié qui a pu utiliser l'emplacement mémoire du mot "
3523 "futex (par exemple des implémentations classiques basées sur futex de mutex "
3524 "Pthreads peuvent provoquer cela dans certaines conditions). Donc, les "
3525 "appelants devraient toujours, à titre conservatoire, supposer qu'un code de "
3526 "retour B<0> peut signifier un faux réveil, et donc utiliser la valeur du mot "
3527 "futex (à savoir le schéma de synchronisation de l'espace utilisateur) pour "
3528 "décider de rester bloqués ou pas."
3529
3530 #. type: TP
3531 #: debian-trixie fedora-44 fedora-rawhide
3532 #, no-wrap
3533 msgid "B<FUTEX_WAKE>"
3534 msgstr "B<FUTEX_WAKE>"
3535
3536 #. type: Plain text
3537 #: debian-trixie fedora-44 fedora-rawhide
3538 msgid "Returns the number of waiters that were woken up."
3539 msgstr "Renvoie le nombre de processus en attente qui ont été réveillés."
3540
3541 #. type: TP
3542 #: debian-trixie fedora-44 fedora-rawhide
3543 #, no-wrap
3544 msgid "B<FUTEX_FD>"
3545 msgstr "B<FUTEX_FD>"
3546
3547 #. type: Plain text
3548 #: debian-trixie fedora-44 fedora-rawhide
3549 msgid "Returns the new file descriptor associated with the futex."
3550 msgstr "Renvoie le nouveau descripteur de fichier associé au futex."
3551
3552 #. type: TP
3553 #: debian-trixie fedora-44 fedora-rawhide
3554 #, no-wrap
3555 msgid "B<FUTEX_REQUEUE>"
3556 msgstr "B<FUTEX_REQUEUE>"
3557
3558 #. type: TP
3559 #: debian-trixie fedora-44 fedora-rawhide
3560 #, no-wrap
3561 msgid "B<FUTEX_CMP_REQUEUE>"
3562 msgstr "B<FUTEX_CMP_REQUEUE>"
3563
3564 #. type: Plain text
3565 #: debian-trixie fedora-44 fedora-rawhide
3566 msgid ""
3567 "Returns the total number of waiters that were woken up or requeued to the "
3568 "futex for the futex word at I<uaddr2>. If this value is greater than "
3569 "I<val>, then the difference is the number of waiters requeued to the futex "
3570 "for the futex word at I<uaddr2>."
3571 msgstr ""
3572 "Renvoie le nombre total d'éléments en attente réveillés ou remis dans la "
3573 "file du futex pour le mot futex sur I<uaddr2>. Si cette valeur est "
3574 "supérieure à I<val>, la différence devient le nombre d'éléments en attente "
3575 "remis dans la file du futex pour le mot futex sur I<uaddr2>."
3576
3577 #. type: TP
3578 #: debian-trixie fedora-44 fedora-rawhide
3579 #, no-wrap
3580 msgid "B<FUTEX_WAKE_OP>"
3581 msgstr "B<FUTEX_WAKE_OP>"
3582
3583 #. type: Plain text
3584 #: debian-trixie fedora-44 fedora-rawhide
3585 msgid ""
3586 "Returns the total number of waiters that were woken up. This is the sum of "
3587 "the woken waiters on the two futexes for the futex words at I<uaddr> and "
3588 "I<uaddr2>."
3589 msgstr ""
3590 "Renvoie le nombre total d'éléments en attente réveillés. Il s'agit de la "
3591 "somme des éléments réveillés sur les deux futex pour les mots futex sur "
3592 "I<uaddr> et I<uaddr2>."
3593
3594 #. type: TP
3595 #: debian-trixie fedora-44 fedora-rawhide
3596 #, no-wrap
3597 msgid "B<FUTEX_WAIT_BITSET>"
3598 msgstr "B<FUTEX_WAIT_BITSET>"
3599
3600 #. type: Plain text
3601 #: debian-trixie fedora-44 fedora-rawhide
3602 msgid ""
3603 "Returns 0 if the caller was woken up. See B<FUTEX_WAIT> for how to "
3604 "interpret this correctly in practice."
3605 msgstr ""
3606 "Renvoie B<0> si l'appelant a été réveillé. Voir B<FUTEX_WAIT> sur la manière "
3607 "d'interpréter cela correctement en pratique."
3608
3609 #. type: TP
3610 #: debian-trixie fedora-44 fedora-rawhide
3611 #, no-wrap
3612 msgid "B<FUTEX_WAKE_BITSET>"
3613 msgstr "B<FUTEX_WAKE_BITSET>"
3614
3615 #. type: TP
3616 #: debian-trixie fedora-44 fedora-rawhide
3617 #, no-wrap
3618 msgid "B<FUTEX_LOCK_PI>"
3619 msgstr "B<FUTEX_LOCK_PI>"
3620
3621 #. type: Plain text
3622 #: debian-trixie fedora-44 fedora-rawhide
3623 msgid "Returns 0 if the futex was successfully locked."
3624 msgstr "Renvoie B<0> si le futex a appliqué le verrou avec succès."
3625
3626 #. type: TP
3627 #: debian-trixie fedora-44 fedora-rawhide
3628 #, no-wrap
3629 msgid "B<FUTEX_LOCK_PI2>"
3630 msgstr "B<FUTEX_LOCK_PI2>"
3631
3632 #. type: TP
3633 #: debian-trixie fedora-44 fedora-rawhide
3634 #, no-wrap
3635 msgid "B<FUTEX_TRYLOCK_PI>"
3636 msgstr "B<FUTEX_TRYLOCK_PI>"
3637
3638 #. type: TP
3639 #: debian-trixie fedora-44 fedora-rawhide
3640 #, no-wrap
3641 msgid "B<FUTEX_UNLOCK_PI>"
3642 msgstr "B<FUTEX_UNLOCK_PI>"
3643
3644 #. type: Plain text
3645 #: debian-trixie fedora-44 fedora-rawhide
3646 msgid "Returns 0 if the futex was successfully unlocked."
3647 msgstr "Renvoie B<0> si le futex a correctement enlevé le verrou."
3648
3649 #. type: TP
3650 #: debian-trixie fedora-44 fedora-rawhide
3651 #, no-wrap
3652 msgid "B<FUTEX_CMP_REQUEUE_PI>"
3653 msgstr "B<FUTEX_CMP_REQUEUE_PI>"
3654
3655 #. type: Plain text
3656 #: debian-trixie fedora-44 fedora-rawhide
3657 msgid ""
3658 "Returns the total number of waiters that were woken up or requeued to the "
3659 "futex for the futex word at I<uaddr2>. If this value is greater than "
3660 "I<val>, then difference is the number of waiters requeued to the futex for "
3661 "the futex word at I<uaddr2>."
3662 msgstr ""
3663 "Renvoie le nombre total d'éléments en attente réveillés ou remis dans la "
3664 "file du futex pour le mot futex sur I<uaddr2>. Si cette valeur est "
3665 "supérieure à I<val>, la différence devient le nombre d'éléments en attente "
3666 "remis dans la file du futex pour le mot futex sur I<uaddr2>."
3667
3668 #. type: TP
3669 #: debian-trixie fedora-44 fedora-rawhide
3670 #, no-wrap
3671 msgid "B<FUTEX_WAIT_REQUEUE_PI>"
3672 msgstr "B<FUTEX_WAIT_REQUEUE_PI>"
3673
3674 #
3675 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3676 #. type: Plain text
3677 #: debian-trixie fedora-44 fedora-rawhide
3678 msgid ""
3679 "Returns 0 if the caller was successfully requeued to the futex for the futex "
3680 "word at I<uaddr2>."
3681 msgstr ""
3682 "Renvoie B<0> si l'appelant a été mis dans la file d'attente avec succès au "
3683 "futex pour le mot futex sur I<uaddr2>."
3684
3685 #. type: TP
3686 #: debian-trixie fedora-44 fedora-rawhide
3687 #, no-wrap
3688 msgid "B<EAGAIN>"
3689 msgstr "B<EAGAIN>"
3690
3691 #. type: Plain text
3692 #: debian-trixie fedora-44 fedora-rawhide
3693 msgid ""
3694 "(B<FUTEX_WAIT>, B<FUTEX_WAIT_BITSET>, B<FUTEX_WAIT_REQUEUE_PI>) The value "
3695 "pointed to by I<uaddr> was not equal to the expected value I<val> at the "
3696 "time of the call."
3697 msgstr ""
3698 "(B<FUTEX_WAIT>, B<FUTEX_WAIT_BITSET>, B<FUTEX_WAIT_REQUEUE_PI>) La valeur "
3699 "vers laquelle pointait I<uaddr> n'était pas égale à la valeur I<val> "
3700 "attendue au moment de l'appel."
3701
3702 #. type: Plain text
3703 #: debian-trixie fedora-44 fedora-rawhide
3704 msgid ""
3705 "B<Note>: on Linux, the symbolic names B<EAGAIN> and B<EWOULDBLOCK> (both of "
3706 "which appear in different parts of the kernel futex code) have the same "
3707 "value."
3708 msgstr ""
3709 "B<Remarque> : sur Linux, les noms symboliques B<EAGAIN> et B<EWOULDBLOCK> "
3710 "(les deux apparaissent dans différents endroits du code futex du noyau) ont "
3711 "la même valeur."
3712
3713 #. type: Plain text
3714 #: debian-trixie fedora-44 fedora-rawhide
3715 msgid ""
3716 "(B<FUTEX_CMP_REQUEUE>, B<FUTEX_CMP_REQUEUE_PI>) The value pointed to by "
3717 "I<uaddr> is not equal to the expected value I<val3>."
3718 msgstr ""
3719 "(B<FUTEX_CMP_REQUEUE>, B<FUTEX_CMP_REQUEUE_PI>) La valeur vers laquelle "
3720 "pointait I<uaddr> n'était pas égale à la valeur I<val3> attendue."
3721
3722 #. type: Plain text
3723 #: debian-trixie fedora-44 fedora-rawhide
3724 msgid ""
3725 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3726 "B<FUTEX_CMP_REQUEUE_PI>) The futex owner thread ID of I<uaddr> (for "
3727 "B<FUTEX_CMP_REQUEUE_PI>: I<uaddr2>) is about to exit, but has not yet "
3728 "handled the internal state cleanup. Try again."
3729 msgstr ""
3730 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3731 "B<FUTEX_CMP_REQUEUE_PI>) L'ID du thread propriétaire du futex sur I<uaddr> "
3732 "(pour B<FUTEX_CMP_REQUEUE_PI> : I<uaddr2>) est sur le point de se terminer, "
3733 "mais il n'a pas encore géré le nettoyage de l'état interne. Réessayez."
3734
3735 #. type: TP
3736 #: debian-trixie fedora-44 fedora-rawhide
3737 #, no-wrap
3738 msgid "B<EDEADLK>"
3739 msgstr "B<EDEADLK>"
3740
3741 #. type: Plain text
3742 #: debian-trixie fedora-44 fedora-rawhide
3743 msgid ""
3744 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3745 "B<FUTEX_CMP_REQUEUE_PI>) The futex word at I<uaddr> is already locked by "
3746 "the caller."
3747 msgstr ""
3748 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3749 "B<FUTEX_CMP_REQUEUE_PI>) Le mot futex sur I<uaddr> est déjà verrouillé par "
3750 "l'appelant."
3751
3752 #
3753 #. FIXME . I see that kernel/locking/rtmutex.c uses EDEADLK in some
3754 #. places, and EDEADLOCK in others. On almost all architectures
3755 #. these constants are synonymous. Is there a reason that both
3756 #. names are used?
3757 #. tglx (July 2015): "No. We should probably fix that."
3758 #. type: Plain text
3759 #: debian-trixie fedora-44 fedora-rawhide
3760 msgid ""
3761 "(B<FUTEX_CMP_REQUEUE_PI>) While requeueing a waiter to the PI futex for the "
3762 "futex word at I<uaddr2>, the kernel detected a deadlock."
3763 msgstr ""
3764 "(B<FUTEX_CMP_REQUEUE_PI>) Pendant qu'il remettait en attente un élément du "
3765 "PI futex pour le mot futex sur I<uaddr2>, le noyau a détecté un verrou mort "
3766 "(deadlock)."
3767
3768 #. type: Plain text
3769 #: debian-trixie fedora-44 fedora-rawhide
3770 msgid ""
3771 "A required pointer argument (i.e., I<uaddr>, I<uaddr2>, or I<timeout>) did "
3772 "not point to a valid user-space address."
3773 msgstr ""
3774 "Le paramètre d'un pointeur nécessaire (c'est-à-dire I<uaddr>, I<uaddr2> ou "
3775 "I<timeout>) ne pointait pas vers une adresse valable de l'espace utilisateur."
3776
3777 #. type: TP
3778 #: debian-trixie fedora-44 fedora-rawhide
3779 #, no-wrap
3780 msgid "B<EINTR>"
3781 msgstr "B<EINTR>"
3782
3783 #. type: Plain text
3784 #: debian-trixie fedora-44 fedora-rawhide
3785 msgid ""
3786 "A B<FUTEX_WAIT> or B<FUTEX_WAIT_BITSET> operation was interrupted by a "
3787 "signal (see B<signal>(7)). Before Linux 2.6.22, this error could also be "
3788 "returned for a spurious wakeup; since Linux 2.6.22, this no longer happens."
3789 msgstr ""
3790 "Une opération B<FUTEX_WAIT> ou B<FUTEX_WAIT_BITSET> a été interrompue par un "
3791 "signal (voir B<signal>(7)). Dans Linux 2.6.22, cette erreur pouvait aussi "
3792 "être renvoyée pour un faux réveil ; depuis Linux 2.6.22, cela n'arrive plus."
3793
3794 #. type: Plain text
3795 #: debian-trixie fedora-44 fedora-rawhide
3796 msgid ""
3797 "The operation in I<futex_op> is one of those that employs a timeout, but the "
3798 "supplied I<timeout> argument was invalid (I<tv_sec> was less than zero, or "
3799 "I<tv_nsec> was not less than 1,000,000,000)."
3800 msgstr ""
3801 "L'opération dans I<futex_op> fait partie de celles qui utilisent un délai, "
3802 "mais le paramètre I<timeout> fourni n'était pas valable (I<tv_sec> valait "
3803 "moins de B<0> ou I<tv_nsec> ne valait pas moins de 1 000 000 000)."
3804
3805 #. type: Plain text
3806 #: debian-trixie fedora-44 fedora-rawhide
3807 msgid ""
3808 "The operation specified in I<futex_op> employs one or both of the pointers "
3809 "I<uaddr> and I<uaddr2>, but one of these does not point to a valid object\\"
3810 "[em]that is, the address is not four-byte-aligned."
3811 msgstr ""
3812 "L'opération indiquée dans I<futex_op> utilise I<uaddr> et/ou I<uaddr2> mais "
3813 "l'un d'eux ne pointe pas vers un objet valable — c'est-à-dire, l'adresse "
3814 "n'est pas alignée sur quatre octets."
3815
3816 #. type: Plain text
3817 #: debian-trixie fedora-44 fedora-rawhide
3818 msgid ""
3819 "(B<FUTEX_WAIT_BITSET>, B<FUTEX_WAKE_BITSET>) The bit mask supplied in "
3820 "I<val3> is zero."
3821 msgstr ""
3822 "(B<FUTEX_WAIT_BITSET>, B<FUTEX_WAKE_BITSET>) Le masque de bit fourni dans "
3823 "I<val3> vaut zéro."
3824
3825 #. type: Plain text
3826 #: debian-trixie fedora-44 fedora-rawhide
3827 msgid ""
3828 "(B<FUTEX_CMP_REQUEUE_PI>) I<uaddr> equals I<uaddr2> (i.e., an attempt was "
3829 "made to requeue to the same futex)."
3830 msgstr ""
3831 "(B<FUTEX_CMP_REQUEUE_PI>) I<uaddr> est égal à I<uaddr2> (c'est-à-dire "
3832 "qu'une remise en attente a été tentée sur le même futex)."
3833
3834 #. type: Plain text
3835 #: debian-trixie fedora-44 fedora-rawhide
3836 msgid "(B<FUTEX_FD>) The signal number supplied in I<val> is invalid."
3837 msgstr ""
3838 "(B<FUTEX_FD>) Le numéro du signal fourni dans I<val> n'est pas valable."
3839
3840 #. type: Plain text
3841 #: debian-trixie fedora-44 fedora-rawhide
3842 msgid ""
3843 "(B<FUTEX_WAKE>, B<FUTEX_WAKE_OP>, B<FUTEX_WAKE_BITSET>, B<FUTEX_REQUEUE>, "
3844 "B<FUTEX_CMP_REQUEUE>) The kernel detected an inconsistency between the user-"
3845 "space state at I<uaddr> and the kernel state\\[em]that is, it detected a "
3846 "waiter which waits in B<FUTEX_LOCK_PI> or B<FUTEX_LOCK_PI2> on I<uaddr>."
3847 msgstr ""
3848 "(B<FUTEX_WAKE>, B<FUTEX_WAKE_OP>, B<FUTEX_WAKE_BITSET>, B<FUTEX_REQUEUE>, "
3849 "B<FUTEX_CMP_REQUEUE>) Le noyau a détecté une incohérence entre l'état de "
3850 "l'espace utilisateur sur I<uaddr> et l'état du noyau — c'est-à-dire qu'il a "
3851 "détecté un élément qui attend dans B<FUTEX_LOCK_PI> ou B<FUTEX_LOCK_PI2> sur "
3852 "I<uaddr>."
3853
3854 #. type: Plain text
3855 #: debian-trixie fedora-44 fedora-rawhide
3856 msgid ""
3857 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3858 "B<FUTEX_UNLOCK_PI>) The kernel detected an inconsistency between the user-"
3859 "space state at I<uaddr> and the kernel state. This indicates either state "
3860 "corruption or that the kernel found a waiter on I<uaddr> which is waiting "
3861 "via B<FUTEX_WAIT> or B<FUTEX_WAIT_BITSET>."
3862 msgstr ""
3863 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3864 "B<FUTEX_UNLOCK_PI>) Le noyau a détecté une incohérence entre l'état de "
3865 "l'espace utilisateur sur I<uaddr> et l'état du noyau. Cela indique soit une "
3866 "corruption d'état, soit que le noyau a trouvé un élément en attente sur "
3867 "I<uaddr> qui attend aussi à l'aide de B<FUTEX_WAIT> ou de "
3868 "B<FUTEX_WAIT_BITSET>."
3869
3870 #. From a conversation with Thomas Gleixner (Aug 2015): ###
3871 #. The kernel sees: I have non PI state for a futex you tried to
3872 #. tell me was PI
3873 #. type: Plain text
3874 #: debian-trixie fedora-44 fedora-rawhide
3875 msgid ""
3876 "(B<FUTEX_CMP_REQUEUE_PI>) The kernel detected an inconsistency between the "
3877 "user-space state at I<uaddr2> and the kernel state; that is, the kernel "
3878 "detected a waiter which waits via B<FUTEX_WAIT> or B<FUTEX_WAIT_BITSET> on "
3879 "I<uaddr2>."
3880 msgstr ""
3881 "(B<FUTEX_CMP_REQUEUE_PI>) Le noyau a détecté une incohérence entre l'état de "
3882 "l'espace utilisateur sur I<uaddr> et l'état du noyau ; c'est-à-dire qu'il a "
3883 "détecté un élément qui attend via B<FUTEX_WAIT> ou B<FUTEX_WAIT_BITSET> sur "
3884 "I<uaddr2>."
3885
3886 #. type: Plain text
3887 #: debian-trixie fedora-44 fedora-rawhide
3888 msgid ""
3889 "(B<FUTEX_CMP_REQUEUE_PI>) The kernel detected an inconsistency between the "
3890 "user-space state at I<uaddr> and the kernel state; that is, the kernel "
3891 "detected a waiter which waits via B<FUTEX_WAIT> or B<FUTEX_WAIT_BITSET> on "
3892 "I<uaddr>."
3893 msgstr ""
3894 "(B<FUTEX_CMP_REQUEUE_PI>) Le noyau a détecté une incohérence entre l'état de "
3895 "l'espace utilisateur sur I<uaddr> et l'état du noyau ; c'est-à-dire qu'il a "
3896 "détecté un élément qui attend à l'aide de B<FUTEX_WAIT> ou de "
3897 "B<FUTEX_WAIT_BITESET> sur I<uaddr>."
3898
3899 #. type: Plain text
3900 #: debian-trixie fedora-44 fedora-rawhide
3901 msgid ""
3902 "(B<FUTEX_CMP_REQUEUE_PI>) The kernel detected an inconsistency between the "
3903 "user-space state at I<uaddr> and the kernel state; that is, the kernel "
3904 "detected a waiter which waits on I<uaddr> via B<FUTEX_LOCK_PI> or "
3905 "B<FUTEX_LOCK_PI2> (instead of B<FUTEX_WAIT_REQUEUE_PI>)."
3906 msgstr ""
3907 "(B<FUTEX_CMP_REQUEUE_PI>) Le noyau a détecté une incohérence entre l'état de "
3908 "l'espace utilisateur sur I<uaddr> et l'état du noyau ; c'est-à-dire qu'il a "
3909 "détecté un élément qui attend à l'aide de B<FUTEX_LOCK_PI> ou de "
3910 "B<FUTEX_LOCK_PI2> (au lieu de B<FUTEX_WAIT_REQUEUE_PI>)."
3911
3912 #. This deals with the case:
3913 #. wait_requeue_pi(A, B);
3914 #. requeue_pi(A, C);
3915 #. type: Plain text
3916 #: debian-trixie fedora-44 fedora-rawhide
3917 msgid ""
3918 "(B<FUTEX_CMP_REQUEUE_PI>) An attempt was made to requeue a waiter to a "
3919 "futex other than that specified by the matching B<FUTEX_WAIT_REQUEUE_PI> "
3920 "call for that waiter."
3921 msgstr ""
3922 "(B<FUTEX_CMP_REQUEUE_PI>) Tentative de remise dans la file d'un élément en "
3923 "attente vers un futex différent de celui indiqué avec l'appel "
3924 "B<FUTEX_WAIT_REQUEUE_PI> correspondant pour cet élément."
3925
3926 #. type: Plain text
3927 #: debian-trixie fedora-44 fedora-rawhide
3928 msgid "(B<FUTEX_CMP_REQUEUE_PI>) The I<val> argument is not 1."
3929 msgstr "(B<FUTEX_CMP_REQUEUE_PI>) Le paramètre I<val> ne vaut pas B<1>."
3930
3931 #. type: TP
3932 #: debian-trixie fedora-44 fedora-rawhide
3933 #, no-wrap
3934 msgid "B<ENFILE>"
3935 msgstr "B<ENFILE>"
3936
3937 #. type: Plain text
3938 #: debian-trixie fedora-44 fedora-rawhide
3939 msgid ""
3940 "(B<FUTEX_FD>) The system-wide limit on the total number of open files has "
3941 "been reached."
3942 msgstr ""
3943 "(B<FUTEX_FD>) La limite du nombre total de fichiers ouverts sur le système a "
3944 "été atteinte."
3945
3946 #. type: TP
3947 #: debian-trixie fedora-44 fedora-rawhide
3948 #, no-wrap
3949 msgid "B<ENOMEM>"
3950 msgstr "B<ENOMEM>"
3951
3952 #. type: Plain text
3953 #: debian-trixie fedora-44 fedora-rawhide
3954 msgid ""
3955 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3956 "B<FUTEX_CMP_REQUEUE_PI>) The kernel could not allocate memory to hold state "
3957 "information."
3958 msgstr ""
3959 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3960 "B<FUTEX_CMP_REQUEUE_PI>) Le noyau n'a pas pu allouer de la mémoire pour "
3961 "conserver les informations d'état."
3962
3963 #. type: Plain text
3964 #: debian-trixie fedora-44 fedora-rawhide
3965 msgid "Invalid operation specified in I<futex_op>."
3966 msgstr "Opération non valable indiquée dans I<futex_op>."
3967
3968 #. type: Plain text
3969 #: debian-trixie fedora-44 fedora-rawhide
3970 msgid ""
3971 "The B<FUTEX_CLOCK_REALTIME> option was specified in I<futex_op>, but the "
3972 "accompanying operation was neither B<FUTEX_WAIT>, B<FUTEX_WAIT_BITSET>, "
3973 "B<FUTEX_WAIT_REQUEUE_PI>, nor B<FUTEX_LOCK_PI2>."
3974 msgstr ""
3975 "L'option B<FUTEX_CLOCK_REALTIME> était indiquée dans I<futex_op>, mais "
3976 "l'opération qui l'accompagne n'est ni B<FUTEX_WAIT>, ni "
3977 "B<FUTEX_WAIT_BITSET>, ni B<FUTEX_WAIT_REQUEUE_PI>, ni B<FUTEX_LOCK_PI2>."
3978
3979 #. type: Plain text
3980 #: debian-trixie fedora-44 fedora-rawhide
3981 msgid ""
3982 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3983 "B<FUTEX_UNLOCK_PI>, B<FUTEX_CMP_REQUEUE_PI>, B<FUTEX_WAIT_REQUEUE_PI>) A "
3984 "run-time check determined that the operation is not available. The PI-futex "
3985 "operations are not implemented on all architectures and are not supported on "
3986 "some CPU variants."
3987 msgstr ""
3988 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
3989 "B<FUTEX_UNLOCK_PI>, B<FUTEX_CMP_REQUEUE_PI>, B<FUTEX_WAIT_REQUEUE_PI>) Une "
3990 "vérification pendant l'exécution a déterminé que l'opération n'est pas "
3991 "disponible. Les opérations PI-futex ne sont pas implémentées sur toutes les "
3992 "architectures et ne sont pas prises en charge sur certaines variantes de "
3993 "processeur."
3994
3995 #. type: TP
3996 #: debian-trixie fedora-44 fedora-rawhide
3997 #, no-wrap
3998 msgid "B<EPERM>"
3999 msgstr "B<EPERM>"
4000
4001 #. type: Plain text
4002 #: debian-trixie fedora-44 fedora-rawhide
4003 msgid ""
4004 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
4005 "B<FUTEX_CMP_REQUEUE_PI>) The caller is not allowed to attach itself to the "
4006 "futex at I<uaddr> (for B<FUTEX_CMP_REQUEUE_PI>: the futex at I<uaddr2>). "
4007 "(This may be caused by a state corruption in user space.)"
4008 msgstr ""
4009 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
4010 "B<FUTEX_CMP_REQUEUE_PI>) L'appelant n'est pas autorisé à se rattacher au "
4011 "futex sur I<uaddr> (pour B<FUTEX_CMP_REQUEUE_PI> : le futex sur I<uaddr2>) "
4012 "(cela peut venir d'une corruption de l'état dans l'espace utilisateur)."
4013
4014 #. type: Plain text
4015 #: debian-trixie fedora-44 fedora-rawhide
4016 msgid ""
4017 "(B<FUTEX_UNLOCK_PI>) The caller does not own the lock represented by the "
4018 "futex word."
4019 msgstr ""
4020 "(B<FUTEX_UNLOCK_PI>) Le verrou représenté par le mot futex n'appartient pas "
4021 "à l'appelant."
4022
4023 #. type: TP
4024 #: debian-trixie fedora-44 fedora-rawhide
4025 #, no-wrap
4026 msgid "B<ESRCH>"
4027 msgstr "B<ESRCH>"
4028
4029 #. type: Plain text
4030 #: debian-trixie fedora-44 fedora-rawhide
4031 msgid ""
4032 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
4033 "B<FUTEX_CMP_REQUEUE_PI>) The thread ID in the futex word at I<uaddr> does "
4034 "not exist."
4035 msgstr ""
4036 "(B<FUTEX_LOCK_PI>, B<FUTEX_LOCK_PI2>, B<FUTEX_TRYLOCK_PI>, "
4037 "B<FUTEX_CMP_REQUEUE_PI>) L'ID du thread dans le mot futex sur I<uaddr> "
4038 "n'existe pas."
4039
4040 #. type: Plain text
4041 #: debian-trixie fedora-44 fedora-rawhide
4042 msgid ""
4043 "(B<FUTEX_CMP_REQUEUE_PI>) The thread ID in the futex word at I<uaddr2> does "
4044 "not exist."
4045 msgstr ""
4046 "(B<FUTEX_CMP_REQUEUE_PI>) L'ID du thread dans le mot futex sur I<uaddr2> "
4047 "n'existe pas."
4048
4049 #. type: TP
4050 #: debian-trixie fedora-44 fedora-rawhide
4051 #, no-wrap
4052 msgid "B<ETIMEDOUT>"
4053 msgstr "B<ETIMEDOUT>"
4054
4055 #
4056 #. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4057 #. type: Plain text
4058 #: debian-trixie fedora-44 fedora-rawhide
4059 msgid ""
4060 "The operation in I<futex_op> employed the timeout specified in I<timeout>, "
4061 "and the timeout expired before the operation completed."
4062 msgstr ""
4063 "L'opération de I<futex_op> a utilisé un délai indiqué dans I<timeout> et le "
4064 "délai a expiré avant la fin de l'opération."
4065
4066 #. type: Plain text
4067 #: debian-trixie fedora-44 fedora-rawhide
4068 #, no-wrap
4069 msgid ""
4070 "$ B<./futex_demo>\n"
4071 "Parent (18534) 0\n"
4072 "Child (18535) 0\n"
4073 "Parent (18534) 1\n"
4074 "Child (18535) 1\n"
4075 "Parent (18534) 2\n"
4076 "Child (18535) 2\n"
4077 "Parent (18534) 3\n"
4078 "Child (18535) 3\n"
4079 "Parent (18534) 4\n"
4080 "Child (18535) 4\n"
4081 msgstr ""
4082 "$ B<./futex_demo>\n"
4083 "Parent (18534) 0\n"
4084 "Child (18535) 0\n"
4085 "Parent (18534) 1\n"
4086 "Child (18535) 1\n"
4087 "Parent (18534) 2\n"
4088 "Child (18535) 2\n"
4089 "Parent (18534) 3\n"
4090 "Child (18535) 3\n"
4091 "Parent (18534) 4\n"
4092 "Child (18535) 4\n"
4093
4094 #. type: Plain text
4095 #: debian-trixie fedora-44 fedora-rawhide
4096 #, no-wrap
4097 msgid ""
4098 "/* futex_demo.c\n"
4099 "\\&\n"
4100 " Usage: futex_demo [nloops]\n"
4101 " (Default: 5)\n"
4102 "\\&\n"
4103 " Demonstrate the use of futexes in a program where parent and child\n"
4104 " use a pair of futexes located inside a shared anonymous mapping to\n"
4105 " synchronize access to a shared resource: the terminal. The two\n"
4106 " processes each write \\[aq]num-loops\\[aq] messages to the terminal and employ\n"
4107 " a synchronization protocol that ensures that they alternate in\n"
4108 " writing messages.\n"
4109 "*/\n"
4110 "#define _GNU_SOURCE\n"
4111 "#include E<lt>err.hE<gt>\n"
4112 "#include E<lt>errno.hE<gt>\n"
4113 "#include E<lt>linux/futex.hE<gt>\n"
4114 "#include E<lt>stdatomic.hE<gt>\n"
4115 "#include E<lt>stdint.hE<gt>\n"
4116 "#include E<lt>stdio.hE<gt>\n"
4117 "#include E<lt>stdlib.hE<gt>\n"
4118 "#include E<lt>sys/mman.hE<gt>\n"
4119 "#include E<lt>sys/syscall.hE<gt>\n"
4120 "#include E<lt>sys/time.hE<gt>\n"
4121 "#include E<lt>sys/wait.hE<gt>\n"
4122 "#include E<lt>unistd.hE<gt>\n"
4123 "\\&\n"
4124 "static uint32_t *futex1, *futex2, *iaddr;\n"
4125 "\\&\n"
4126 "static int\n"
4127 "futex(uint32_t *uaddr, int futex_op, uint32_t val,\n"
4128 " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
4129 "{\n"
4130 " return syscall(SYS_futex, uaddr, futex_op, val,\n"
4131 " timeout, uaddr2, val3);\n"
4132 "}\n"
4133 "\\&\n"
4134 "/* Acquire the futex pointed to by \\[aq]futexp\\[aq]: wait for its value to\n"
4135 " become 1, and then set the value to 0. */\n"
4136 "\\&\n"
4137 "static void\n"
4138 "fwait(uint32_t *futexp)\n"
4139 "{\n"
4140 " long s;\n"
4141 " const uint32_t one = 1;\n"
4142 "\\&\n"
4143 " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
4144 " atomically performs the equivalent of:\n"
4145 "\\&\n"
4146 " if (*ptr == *oldval)\n"
4147 " *ptr = newval;\n"
4148 "\\&\n"
4149 " It returns true if the test yielded true and *ptr was updated. */\n"
4150 "\\&\n"
4151 " while (1) {\n"
4152 "\\&\n"
4153 " /* Is the futex available? */\n"
4154 " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
4155 " break; /* Yes */\n"
4156 "\\&\n"
4157 " /* Futex is not available; wait. */\n"
4158 "\\&\n"
4159 " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
4160 " if (s == -1 && errno != EAGAIN)\n"
4161 " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
4162 " }\n"
4163 "}\n"
4164 "\\&\n"
4165 "/* Release the futex pointed to by \\[aq]futexp\\[aq]: if the futex currently\n"
4166 " has the value 0, set its value to 1 and then wake any futex waiters,\n"
4167 " so that if the peer is blocked in fwait(), it can proceed. */\n"
4168 "\\&\n"
4169 "static void\n"
4170 "fpost(uint32_t *futexp)\n"
4171 "{\n"
4172 " long s;\n"
4173 " const uint32_t zero = 0;\n"
4174 "\\&\n"
4175 " /* atomic_compare_exchange_strong() was described\n"
4176 " in comments above. */\n"
4177 "\\&\n"
4178 " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
4179 " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
4180 " if (s == -1)\n"
4181 " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
4182 " }\n"
4183 "}\n"
4184 "\\&\n"
4185 "int\n"
4186 "main(int argc, char *argv[])\n"
4187 "{\n"
4188 " pid_t childPid;\n"
4189 " unsigned int nloops;\n"
4190 "\\&\n"
4191 " setbuf(stdout, NULL);\n"
4192 "\\&\n"
4193 " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
4194 "\\&\n"
4195 " /* Create a shared anonymous mapping that will hold the futexes.\n"
4196 " Since the futexes are being shared between processes, we\n"
4197 " subsequently use the \"shared\" futex operations (i.e., not the\n"
4198 " ones suffixed \"_PRIVATE\"). */\n"
4199 "\\&\n"
4200 " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
4201 " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
4202 " if (iaddr == MAP_FAILED)\n"
4203 " err(EXIT_FAILURE, \"mmap\");\n"
4204 "\\&\n"
4205 " futex1 = &iaddr[0];\n"
4206 " futex2 = &iaddr[1];\n"
4207 "\\&\n"
4208 " *futex1 = 0; /* State: unavailable */\n"
4209 " *futex2 = 1; /* State: available */\n"
4210 "\\&\n"
4211 " /* Create a child process that inherits the shared anonymous\n"
4212 " mapping. */\n"
4213 "\\&\n"
4214 " childPid = fork();\n"
4215 " if (childPid == -1)\n"
4216 " err(EXIT_FAILURE, \"fork\");\n"
4217 "\\&\n"
4218 " if (childPid == 0) { /* Child */\n"
4219 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4220 " fwait(futex1);\n"
4221 " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4222 " fpost(futex2);\n"
4223 " }\n"
4224 "\\&\n"
4225 " exit(EXIT_SUCCESS);\n"
4226 " }\n"
4227 "\\&\n"
4228 " /* Parent falls through to here. */\n"
4229 "\\&\n"
4230 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4231 " fwait(futex2);\n"
4232 " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4233 " fpost(futex1);\n"
4234 " }\n"
4235 "\\&\n"
4236 " wait(NULL);\n"
4237 "\\&\n"
4238 " exit(EXIT_SUCCESS);\n"
4239 "}\n"
4240 msgstr ""
4241 "/* futex_demo.c\n"
4242 "\\&\n"
4243 " Usage: futex_demo [nloops]\n"
4244 " (Default: 5)\n"
4245 "\\&\n"
4246 " Montrer l'utilisation des futex dans un programme où le parent et\n"
4247 " l'enfant utilisent une paire de futex située dans un tableau anonyme\n"
4248 " partagé pour synchroniser l'accès à une ressource partagée : le\n"
4249 " terminal. Les processus écrivent chacun des messages \\[aq]num-loops\\[aq]\n"
4250 " sur le terminal et ils utilisent un protocole de synchronisation qui\n"
4251 " garantit qu'ils alternent l'écriture des messages.\n"
4252 "*/\n"
4253 "#define _GNU_SOURCE\n"
4254 "#include E<lt>err.hE<gt>\n"
4255 "#include E<lt>errno.hE<gt>\n"
4256 "#include E<lt>linux/futex.hE<gt>\n"
4257 "#include E<lt>stdatomic.hE<gt>\n"
4258 "#include E<lt>stdint.hE<gt>\n"
4259 "#include E<lt>stdio.hE<gt>\n"
4260 "#include E<lt>stdlib.hE<gt>\n"
4261 "#include E<lt>sys/mman.hE<gt>\n"
4262 "#include E<lt>sys/syscall.hE<gt>\n"
4263 "#include E<lt>sys/time.hE<gt>\n"
4264 "#include E<lt>sys/wait.hE<gt>\n"
4265 "#include E<lt>unistd.hE<gt>\n"
4266 "\\&\n"
4267 "static uint32_t *futex1, *futex2, *iaddr;\n"
4268 "\\&\n"
4269 "static int\n"
4270 "futex(uint32_t *uaddr, int futex_op, uint32_t val,\n"
4271 " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
4272 "{\n"
4273 " return syscall(SYS_futex, uaddr, futex_op, val,\n"
4274 " timeout, uaddr2, val3);\n"
4275 "}\n"
4276 "\\&\n"
4277 "/* Acquérir le futex vers lequel pointe \\[aq]futexp\\[aq] : attendre que sa\n"
4278 " valeur passe à 1 puis positionner la valeur sur 0. */\n"
4279 "\\&\n"
4280 "static void\n"
4281 "fwait(uint32_t *futexp)\n"
4282 "{\n"
4283 " long s;\n"
4284 " const uint32_t one = 1;\n"
4285 "\\&\n"
4286 " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
4287 " fait atomiquement comme :\n"
4288 "\\&\n"
4289 " if (*ptr == *oldval)\n"
4290 " *ptr = newval;\n"
4291 "\\&\n"
4292 " Il renvoie true si le test a montré true et *ptr a été mis à jour. */\n"
4293 "\\&\n"
4294 " while (1) {\n"
4295 "\\&\n"
4296 " /* Le futex est-il disponible ? */\n"
4297 " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
4298 " break; /* Oui */\n"
4299 "\\&\n"
4300 " /* Le futex n'est pas disponible ; attendre. */\n"
4301 "\\&\n"
4302 " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
4303 " if (s == -1 && errno != EAGAIN)\n"
4304 " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
4305 " }\n"
4306 "}\n"
4307 "\\&\n"
4308 "/* Relâcher le futex vers lequel pointe \\[aq]futexp\\[aq] : si le futex a\n"
4309 " actuellement la valeur 0, positionner la valeur à 1 et réveiller tous les\n"
4310 " futex en attente pour que si le pair est bloqué dans fwait(), ça puisse\n"
4311 " continuer. */\n"
4312 "\\&\n"
4313 "static void\n"
4314 "fpost(uint32_t *futexp)\n"
4315 "{\n"
4316 " long s;\n"
4317 " const uint32_t zero = 0;\n"
4318 "\\&\n"
4319 " /* atomic_compare_exchange_strong() a été décrit\n"
4320 " dans les commentaires ci-dessus. */\n"
4321 "\\&\n"
4322 " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
4323 " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
4324 " if (s == -1)\n"
4325 " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
4326 " }\n"
4327 "}\n"
4328 "\\&\n"
4329 "int\n"
4330 "main(int argc, char *argv[])\n"
4331 "{\n"
4332 " pid_t childPid;\n"
4333 " unsigned int nloops;\n"
4334 "\\&\n"
4335 " setbuf(stdout, NULL);\n"
4336 "\\&\n"
4337 " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
4338 "\\&\n"
4339 " /* Créer un tableau anonyme partagé qui gardera les futex.\n"
4340 " Comme les futex vont être partagés entre les processus, nous\n"
4341 " utilisons donc les opérations futex « shared » (donc pas celles\n"
4342 " dont le suffixe est \"_PRIVATE\") */\n"
4343 "\\&\n"
4344 " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
4345 " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
4346 " if (iaddr == MAP_FAILED)\n"
4347 " err(EXIT_FAILURE, \"mmap\");\n"
4348 "\\&\n"
4349 " futex1 = &iaddr[0];\n"
4350 " futex2 = &iaddr[1];\n"
4351 "\\&\n"
4352 " *futex1 = 0; /* State: unavailable */\n"
4353 " *futex2 = 1; /* State: available */\n"
4354 "\\&\n"
4355 " /* Créer un processus enfant qui hérite du tableau anonyme\n"
4356 " partagé. */\n"
4357 "\\&\n"
4358 " childPid = fork();\n"
4359 " if (childPid == -1)\n"
4360 " err(EXIT_FAILURE, \"fork\");\n"
4361 "\\&\n"
4362 " if (childPid == 0) { /* Child */\n"
4363 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4364 " fwait(futex1);\n"
4365 " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4366 " fpost(futex2);\n"
4367 " }\n"
4368 "\\&\n"
4369 " exit(EXIT_SUCCESS);\n"
4370 " }\n"
4371 "\\&\n"
4372 " /* Le parent se retrouve ici. */\n"
4373 "\\&\n"
4374 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4375 " fwait(futex2);\n"
4376 " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4377 " fpost(futex1);\n"
4378 " }\n"
4379 "\\&\n"
4380 " wait(NULL);\n"
4381 "\\&\n"
4382 " exit(EXIT_SUCCESS);\n"
4383 "}\n"
4384
4385 #. type: Plain text
4386 #: debian-trixie fedora-44 fedora-rawhide
4387 msgid "I<Documentation/pi-futex.txt>"
4388 msgstr "I<Documentation/pi-futex.txt>"
4389
4390 #. type: Plain text
4391 #: debian-trixie fedora-44 fedora-rawhide
4392 msgid "I<Documentation/futex-requeue-pi.txt>"
4393 msgstr "I<Documentation/futex-requeue-pi.txt>"
4394
4395 #. type: Plain text
4396 #: debian-trixie fedora-44 fedora-rawhide
4397 msgid "I<Documentation/locking/rt-mutex.txt>"
4398 msgstr "I<Documentation/locking/rt-mutex.txt>"
4399
4400 #. type: Plain text
4401 #: debian-trixie fedora-44 fedora-rawhide
4402 msgid "I<Documentation/locking/rt-mutex-design.txt>"
4403 msgstr "I<Documentation/locking/rt-mutex-design.txt>"
4404
4405 #. type: Plain text
4406 #: debian-trixie fedora-44 fedora-rawhide
4407 msgid "I<Documentation/robust-futex-ABI.txt>"
4408 msgstr "I<Documentation/robust-futex-ABI.txt>"
4409
4410 #. type: Plain text
4411 #: debian-trixie fedora-44 fedora-rawhide
4412 msgid ""
4413 "Franke, H., Russell, R., and Kirwood, M., 2002. I<Fuss, Futexes and "
4414 "Furwocks: Fast Userlevel Locking in Linux> (from proceedings of the Ottawa "
4415 "Linux Symposium 2002),"
4416 msgstr ""
4417 "Franke, H., Russell, R., and Kirwood, M., 2002. I<Fuss, Futexes and "
4418 "Furwocks: Fast Userlevel Locking in Linux> (à partir des actions d'Ottawa "
4419 "Linux Symposium 2002),"
4420
4421 #. type: Plain text
4422 #: debian-trixie fedora-44 fedora-rawhide
4423 msgid ""
4424 "E<.UR http://kernel.org\\:/doc\\:/ols\\:/2002\\:/ols2002-pages-479-495.pdf> "
4425 "E<.UE>"
4426 msgstr ""
4427 "E<.UR http://kernel.org\\:/doc\\:/ols\\:/2002\\:/ols2002-pages-479-495.pdf> "
4428 "E<.UE>"
4429
4430 #. type: Plain text
4431 #: debian-trixie fedora-44 fedora-rawhide
4432 msgid ""
4433 "Hart, D., 2009. I<A futex overview and update>, E<.UR http://lwn.net/"
4434 "Articles/360699/> E<.UE>"
4435 msgstr ""
4436 "Hart, D., 2009. I<A futex overview and update>, E<.UR http://lwn.net/"
4437 "Articles/360699/> E<.UE>"
4438
4439 #. type: Plain text
4440 #: debian-trixie fedora-44 fedora-rawhide
4441 msgid ""
4442 "Hart, D.\\& and Guniguntala, D., 2009. I<Requeue-PI: Making glibc Condvars "
4443 "PI-Aware> (from proceedings of the 2009 Real-Time Linux Workshop), E<.UR "
4444 "http://lwn.net/images/conf/rtlws11/papers/proc/p10.pdf> E<.UE>"
4445 msgstr ""
4446 "Hart, D. et Guniguntala, D., 2009. I<Requeue-PI: Making Glibc Condvars PI-"
4447 "Aware> (à partir des comptes rendus de l'atelier Real-Time Linux 2009), "
4448 "E<.UR http://lwn.net/images/conf/rtlws11/papers/proc/p10.pdf> E<.UE>"
4449
4450 #. type: Plain text
4451 #: debian-trixie fedora-44 fedora-rawhide
4452 msgid ""
4453 "Drepper, U., 2011. I<Futexes Are Tricky>, E<.UR http://www.akkadia.org/"
4454 "drepper/futex.pdf> E<.UE>"
4455 msgstr ""
4456 "Drepper, U., 2011. I<Futexes Are Tricky>, E<.UR http://www.akkadia.org/"
4457 "drepper/futex.pdf> E<.UE>"
4458
4459 #. type: Plain text
4460 #: debian-trixie fedora-44 fedora-rawhide
4461 msgid "Futex example library, futex-*.tar.bz2 at"
4462 msgstr "La bibliothèque d'exemples de futex, futex-*.tar.bz2 à"
4463
4464 #. type: Plain text
4465 #: debian-trixie fedora-44 fedora-rawhide
4466 msgid ""
4467 "E<.UR https://mirrors.kernel.org\\:/pub\\:/linux\\:/kernel\\:/people\\:/"
4468 "rusty/> E<.UE>"
4469 msgstr ""
4470 "E<.UR https://mirrors.kernel.org\\:/pub\\:/linux\\:/kernel\\:/people\\:/"
4471 "rusty/> E<.UE>"
4472
4473 #. type: TH
4474 #: fedora-44 fedora-rawhide
4475 #, no-wrap
4476 msgid "2024-07-23"
4477 msgstr "23 juillet 2024"
4478
4479 #. type: TH
4480 #: fedora-44 fedora-rawhide
4481 #, no-wrap
4482 msgid "Linux man-pages 6.13"
4483 msgstr "Pages du manuel de Linux 6.13"
4484
4485 #. type: TH
4486 #: mageia-cauldron
4487 #, no-wrap
4488 msgid "2026-02-08"
4489 msgstr "8 février 2026"
4490
4491 #. type: TH
4492 #: mageia-cauldron
4493 #, no-wrap
4494 msgid "Linux man-pages 6.17"
4495 msgstr "Pages du manuel de Linux 6.17"
4496
4497 #. type: Plain text
4498 #: mageia-cauldron
4499 #, fuzzy, no-wrap
4500 #| msgid ""
4501 #| "/* futex_demo.c\n"
4502 #| "\\&\n"
4503 #| " Usage: futex_demo [nloops]\n"
4504 #| " (Default: 5)\n"
4505 #| "\\&\n"
4506 #| " Demonstrate the use of futexes in a program where parent and child\n"
4507 #| " use a pair of futexes located inside a shared anonymous mapping to\n"
4508 #| " synchronize access to a shared resource: the terminal. The two\n"
4509 #| " processes each write \\[aq]num-loops\\[aq] messages to the terminal and employ\n"
4510 #| " a synchronization protocol that ensures that they alternate in\n"
4511 #| " writing messages.\n"
4512 #| "*/\n"
4513 #| "#define _GNU_SOURCE\n"
4514 #| "#include E<lt>err.hE<gt>\n"
4515 #| "#include E<lt>errno.hE<gt>\n"
4516 #| "#include E<lt>linux/futex.hE<gt>\n"
4517 #| "#include E<lt>stdatomic.hE<gt>\n"
4518 #| "#include E<lt>stdint.hE<gt>\n"
4519 #| "#include E<lt>stdio.hE<gt>\n"
4520 #| "#include E<lt>stdlib.hE<gt>\n"
4521 #| "#include E<lt>sys/mman.hE<gt>\n"
4522 #| "#include E<lt>sys/syscall.hE<gt>\n"
4523 #| "#include E<lt>sys/time.hE<gt>\n"
4524 #| "#include E<lt>sys/wait.hE<gt>\n"
4525 #| "#include E<lt>unistd.hE<gt>\n"
4526 #| "\\&\n"
4527 #| "static uint32_t *futex1, *futex2, *iaddr;\n"
4528 #| "\\&\n"
4529 #| "static int\n"
4530 #| "futex(uint32_t *uaddr, int futex_op, uint32_t val,\n"
4531 #| " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
4532 #| "{\n"
4533 #| " return syscall(SYS_futex, uaddr, futex_op, val,\n"
4534 #| " timeout, uaddr2, val3);\n"
4535 #| "}\n"
4536 #| "\\&\n"
4537 #| "/* Acquire the futex pointed to by \\[aq]futexp\\[aq]: wait for its value to\n"
4538 #| " become 1, and then set the value to 0. */\n"
4539 #| "\\&\n"
4540 #| "static void\n"
4541 #| "fwait(uint32_t *futexp)\n"
4542 #| "{\n"
4543 #| " long s;\n"
4544 #| " const uint32_t one = 1;\n"
4545 #| "\\&\n"
4546 #| " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
4547 #| " atomically performs the equivalent of:\n"
4548 #| "\\&\n"
4549 #| " if (*ptr == *oldval)\n"
4550 #| " *ptr = newval;\n"
4551 #| "\\&\n"
4552 #| " It returns true if the test yielded true and *ptr was updated. */\n"
4553 #| "\\&\n"
4554 #| " while (1) {\n"
4555 #| "\\&\n"
4556 #| " /* Is the futex available? */\n"
4557 #| " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
4558 #| " break; /* Yes */\n"
4559 #| "\\&\n"
4560 #| " /* Futex is not available; wait. */\n"
4561 #| "\\&\n"
4562 #| " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
4563 #| " if (s == -1 && errno != EAGAIN)\n"
4564 #| " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
4565 #| " }\n"
4566 #| "}\n"
4567 #| "\\&\n"
4568 #| "/* Release the futex pointed to by \\[aq]futexp\\[aq]: if the futex currently\n"
4569 #| " has the value 0, set its value to 1 and then wake any futex waiters,\n"
4570 #| " so that if the peer is blocked in fwait(), it can proceed. */\n"
4571 #| "\\&\n"
4572 #| "static void\n"
4573 #| "fpost(uint32_t *futexp)\n"
4574 #| "{\n"
4575 #| " long s;\n"
4576 #| " const uint32_t zero = 0;\n"
4577 #| "\\&\n"
4578 #| " /* atomic_compare_exchange_strong() was described\n"
4579 #| " in comments above. */\n"
4580 #| "\\&\n"
4581 #| " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
4582 #| " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
4583 #| " if (s == -1)\n"
4584 #| " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
4585 #| " }\n"
4586 #| "}\n"
4587 #| "\\&\n"
4588 #| "int\n"
4589 #| "main(int argc, char *argv[])\n"
4590 #| "{\n"
4591 #| " pid_t childPid;\n"
4592 #| " unsigned int nloops;\n"
4593 #| "\\&\n"
4594 #| " setbuf(stdout, NULL);\n"
4595 #| "\\&\n"
4596 #| " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
4597 #| "\\&\n"
4598 #| " /* Create a shared anonymous mapping that will hold the futexes.\n"
4599 #| " Since the futexes are being shared between processes, we\n"
4600 #| " subsequently use the \"shared\" futex operations (i.e., not the\n"
4601 #| " ones suffixed \"_PRIVATE\"). */\n"
4602 #| "\\&\n"
4603 #| " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
4604 #| " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
4605 #| " if (iaddr == MAP_FAILED)\n"
4606 #| " err(EXIT_FAILURE, \"mmap\");\n"
4607 #| "\\&\n"
4608 #| " futex1 = &iaddr[0];\n"
4609 #| " futex2 = &iaddr[1];\n"
4610 #| "\\&\n"
4611 #| " *futex1 = 0; /* State: unavailable */\n"
4612 #| " *futex2 = 1; /* State: available */\n"
4613 #| "\\&\n"
4614 #| " /* Create a child process that inherits the shared anonymous\n"
4615 #| " mapping. */\n"
4616 #| "\\&\n"
4617 #| " childPid = fork();\n"
4618 #| " if (childPid == -1)\n"
4619 #| " err(EXIT_FAILURE, \"fork\");\n"
4620 #| "\\&\n"
4621 #| " if (childPid == 0) { /* Child */\n"
4622 #| " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4623 #| " fwait(futex1);\n"
4624 #| " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4625 #| " fpost(futex2);\n"
4626 #| " }\n"
4627 #| "\\&\n"
4628 #| " exit(EXIT_SUCCESS);\n"
4629 #| " }\n"
4630 #| "\\&\n"
4631 #| " /* Parent falls through to here. */\n"
4632 #| "\\&\n"
4633 #| " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4634 #| " fwait(futex2);\n"
4635 #| " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4636 #| " fpost(futex1);\n"
4637 #| " }\n"
4638 #| "\\&\n"
4639 #| " wait(NULL);\n"
4640 #| "\\&\n"
4641 #| " exit(EXIT_SUCCESS);\n"
4642 #| "}\n"
4643 msgid ""
4644 "/* futex_demo.c\n"
4645 "\\&\n"
4646 " Usage: futex_demo [nloops]\n"
4647 " (Default: 5)\n"
4648 "\\&\n"
4649 " Demonstrate the use of futexes in a program where parent and child\n"
4650 " use a pair of futexes located inside a shared anonymous mapping to\n"
4651 " synchronize access to a shared resource: the terminal. The two\n"
4652 " processes each write \\[aq]num-loops\\[aq] messages to the terminal and employ\n"
4653 " a synchronization protocol that ensures that they alternate in\n"
4654 " writing messages.\n"
4655 "*/\n"
4656 "#define _GNU_SOURCE\n"
4657 "#include E<lt>err.hE<gt>\n"
4658 "#include E<lt>errno.hE<gt>\n"
4659 "#include E<lt>linux/futex.hE<gt>\n"
4660 "#include E<lt>stdatomic.hE<gt>\n"
4661 "#include E<lt>stdint.hE<gt>\n"
4662 "#include E<lt>stdio.hE<gt>\n"
4663 "#include E<lt>stdlib.hE<gt>\n"
4664 "#include E<lt>sys/mman.hE<gt>\n"
4665 "#include E<lt>sys/syscall.hE<gt>\n"
4666 "#include E<lt>sys/time.hE<gt>\n"
4667 "#include E<lt>sys/wait.hE<gt>\n"
4668 "#include E<lt>unistd.hE<gt>\n"
4669 "\\&\n"
4670 "static uint32_t *futex1, *futex2, *iaddr;\n"
4671 "\\&\n"
4672 "static int\n"
4673 "futex(uint32_t *uaddr, int op, uint32_t val,\n"
4674 " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
4675 "{\n"
4676 " return syscall(SYS_futex, uaddr, op, val,\n"
4677 " timeout, uaddr2, val3);\n"
4678 "}\n"
4679 "\\&\n"
4680 "/* Acquire the futex pointed to by \\[aq]futexp\\[aq]: wait for its value to\n"
4681 " become 1, and then set the value to 0. */\n"
4682 "\\&\n"
4683 "static void\n"
4684 "fwait(uint32_t *futexp)\n"
4685 "{\n"
4686 " long s;\n"
4687 " const uint32_t one = 1;\n"
4688 "\\&\n"
4689 " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
4690 " atomically performs the equivalent of:\n"
4691 "\\&\n"
4692 " if (*ptr == *oldval)\n"
4693 " *ptr = newval;\n"
4694 "\\&\n"
4695 " It returns true if the test yielded true and *ptr was updated. */\n"
4696 "\\&\n"
4697 " while (1) {\n"
4698 "\\&\n"
4699 " /* Is the futex available? */\n"
4700 " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
4701 " break; /* Yes */\n"
4702 "\\&\n"
4703 " /* Futex is not available; wait. */\n"
4704 "\\&\n"
4705 " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
4706 " if (s == -1 && errno != EAGAIN)\n"
4707 " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
4708 " }\n"
4709 "}\n"
4710 "\\&\n"
4711 "/* Release the futex pointed to by \\[aq]futexp\\[aq]: if the futex currently\n"
4712 " has the value 0, set its value to 1 and then wake any futex waiters,\n"
4713 " so that if the peer is blocked in fwait(), it can proceed. */\n"
4714 "\\&\n"
4715 "static void\n"
4716 "fpost(uint32_t *futexp)\n"
4717 "{\n"
4718 " long s;\n"
4719 " const uint32_t zero = 0;\n"
4720 "\\&\n"
4721 " /* atomic_compare_exchange_strong() was described\n"
4722 " in comments above. */\n"
4723 "\\&\n"
4724 " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
4725 " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
4726 " if (s == -1)\n"
4727 " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
4728 " }\n"
4729 "}\n"
4730 "\\&\n"
4731 "int\n"
4732 "main(int argc, char *argv[])\n"
4733 "{\n"
4734 " pid_t childPid;\n"
4735 " unsigned int nloops;\n"
4736 "\\&\n"
4737 " setbuf(stdout, NULL);\n"
4738 "\\&\n"
4739 " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
4740 "\\&\n"
4741 " /* Create a shared anonymous mapping that will hold the futexes.\n"
4742 " Since the futexes are being shared between processes, we\n"
4743 " subsequently use the \"shared\" futex operations (i.e., not the\n"
4744 " ones suffixed \"_PRIVATE\"). */\n"
4745 "\\&\n"
4746 " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
4747 " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
4748 " if (iaddr == MAP_FAILED)\n"
4749 " err(EXIT_FAILURE, \"mmap\");\n"
4750 "\\&\n"
4751 " futex1 = &iaddr[0];\n"
4752 " futex2 = &iaddr[1];\n"
4753 "\\&\n"
4754 " *futex1 = 0; /* State: unavailable */\n"
4755 " *futex2 = 1; /* State: available */\n"
4756 "\\&\n"
4757 " /* Create a child process that inherits the shared anonymous\n"
4758 " mapping. */\n"
4759 "\\&\n"
4760 " childPid = fork();\n"
4761 " if (childPid == -1)\n"
4762 " err(EXIT_FAILURE, \"fork\");\n"
4763 "\\&\n"
4764 " if (childPid == 0) { /* Child */\n"
4765 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4766 " fwait(futex1);\n"
4767 " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4768 " fpost(futex2);\n"
4769 " }\n"
4770 "\\&\n"
4771 " exit(EXIT_SUCCESS);\n"
4772 " }\n"
4773 "\\&\n"
4774 " /* Parent falls through to here. */\n"
4775 "\\&\n"
4776 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4777 " fwait(futex2);\n"
4778 " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4779 " fpost(futex1);\n"
4780 " }\n"
4781 "\\&\n"
4782 " wait(NULL);\n"
4783 "\\&\n"
4784 " exit(EXIT_SUCCESS);\n"
4785 "}\n"
4786 msgstr ""
4787 "/* futex_demo.c\n"
4788 "\\&\n"
4789 " Usage: futex_demo [nloops]\n"
4790 " (Default: 5)\n"
4791 "\\&\n"
4792 " Montrer l'utilisation des futex dans un programme où le parent et\n"
4793 " l'enfant utilisent une paire de futex située dans un tableau anonyme\n"
4794 " partagé pour synchroniser l'accès à une ressource partagée : le\n"
4795 " terminal. Les processus écrivent chacun des messages \\[aq]num-loops\\[aq]\n"
4796 " sur le terminal et ils utilisent un protocole de synchronisation qui\n"
4797 " garantit qu'ils alternent l'écriture des messages.\n"
4798 "*/\n"
4799 "#define _GNU_SOURCE\n"
4800 "#include E<lt>err.hE<gt>\n"
4801 "#include E<lt>errno.hE<gt>\n"
4802 "#include E<lt>linux/futex.hE<gt>\n"
4803 "#include E<lt>stdatomic.hE<gt>\n"
4804 "#include E<lt>stdint.hE<gt>\n"
4805 "#include E<lt>stdio.hE<gt>\n"
4806 "#include E<lt>stdlib.hE<gt>\n"
4807 "#include E<lt>sys/mman.hE<gt>\n"
4808 "#include E<lt>sys/syscall.hE<gt>\n"
4809 "#include E<lt>sys/time.hE<gt>\n"
4810 "#include E<lt>sys/wait.hE<gt>\n"
4811 "#include E<lt>unistd.hE<gt>\n"
4812 "\\&\n"
4813 "static uint32_t *futex1, *futex2, *iaddr;\n"
4814 "\\&\n"
4815 "static int\n"
4816 "futex(uint32_t *uaddr, int futex_op, uint32_t val,\n"
4817 " const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)\n"
4818 "{\n"
4819 " return syscall(SYS_futex, uaddr, futex_op, val,\n"
4820 " timeout, uaddr2, val3);\n"
4821 "}\n"
4822 "\\&\n"
4823 "/* Acquérir le futex vers lequel pointe \\[aq]futexp\\[aq] : attendre que sa\n"
4824 " valeur passe à 1 puis positionner la valeur sur 0. */\n"
4825 "\\&\n"
4826 "static void\n"
4827 "fwait(uint32_t *futexp)\n"
4828 "{\n"
4829 " long s;\n"
4830 " const uint32_t one = 1;\n"
4831 "\\&\n"
4832 " /* atomic_compare_exchange_strong(ptr, oldval, newval)\n"
4833 " fait atomiquement comme :\n"
4834 "\\&\n"
4835 " if (*ptr == *oldval)\n"
4836 " *ptr = newval;\n"
4837 "\\&\n"
4838 " Il renvoie true si le test a montré true et *ptr a été mis à jour. */\n"
4839 "\\&\n"
4840 " while (1) {\n"
4841 "\\&\n"
4842 " /* Le futex est-il disponible ? */\n"
4843 " if (atomic_compare_exchange_strong(futexp, &one, 0))\n"
4844 " break; /* Oui */\n"
4845 "\\&\n"
4846 " /* Le futex n'est pas disponible ; attendre. */\n"
4847 "\\&\n"
4848 " s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);\n"
4849 " if (s == -1 && errno != EAGAIN)\n"
4850 " err(EXIT_FAILURE, \"futex-FUTEX_WAIT\");\n"
4851 " }\n"
4852 "}\n"
4853 "\\&\n"
4854 "/* Relâcher le futex vers lequel pointe \\[aq]futexp\\[aq] : si le futex a\n"
4855 " actuellement la valeur 0, positionner la valeur à 1 et réveiller tous les\n"
4856 " futex en attente pour que si le pair est bloqué dans fwait(), ça puisse\n"
4857 " continuer. */\n"
4858 "\\&\n"
4859 "static void\n"
4860 "fpost(uint32_t *futexp)\n"
4861 "{\n"
4862 " long s;\n"
4863 " const uint32_t zero = 0;\n"
4864 "\\&\n"
4865 " /* atomic_compare_exchange_strong() a été décrit\n"
4866 " dans les commentaires ci-dessus. */\n"
4867 "\\&\n"
4868 " if (atomic_compare_exchange_strong(futexp, &zero, 1)) {\n"
4869 " s = futex(futexp, FUTEX_WAKE, 1, NULL, NULL, 0);\n"
4870 " if (s == -1)\n"
4871 " err(EXIT_FAILURE, \"futex-FUTEX_WAKE\");\n"
4872 " }\n"
4873 "}\n"
4874 "\\&\n"
4875 "int\n"
4876 "main(int argc, char *argv[])\n"
4877 "{\n"
4878 " pid_t childPid;\n"
4879 " unsigned int nloops;\n"
4880 "\\&\n"
4881 " setbuf(stdout, NULL);\n"
4882 "\\&\n"
4883 " nloops = (argc E<gt> 1) ? atoi(argv[1]) : 5;\n"
4884 "\\&\n"
4885 " /* Créer un tableau anonyme partagé qui gardera les futex.\n"
4886 " Comme les futex vont être partagés entre les processus, nous\n"
4887 " utilisons donc les opérations futex « shared » (donc pas celles\n"
4888 " dont le suffixe est \"_PRIVATE\") */\n"
4889 "\\&\n"
4890 " iaddr = mmap(NULL, sizeof(*iaddr) * 2, PROT_READ | PROT_WRITE,\n"
4891 " MAP_ANONYMOUS | MAP_SHARED, -1, 0);\n"
4892 " if (iaddr == MAP_FAILED)\n"
4893 " err(EXIT_FAILURE, \"mmap\");\n"
4894 "\\&\n"
4895 " futex1 = &iaddr[0];\n"
4896 " futex2 = &iaddr[1];\n"
4897 "\\&\n"
4898 " *futex1 = 0; /* State: unavailable */\n"
4899 " *futex2 = 1; /* State: available */\n"
4900 "\\&\n"
4901 " /* Créer un processus enfant qui hérite du tableau anonyme\n"
4902 " partagé. */\n"
4903 "\\&\n"
4904 " childPid = fork();\n"
4905 " if (childPid == -1)\n"
4906 " err(EXIT_FAILURE, \"fork\");\n"
4907 "\\&\n"
4908 " if (childPid == 0) { /* Child */\n"
4909 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4910 " fwait(futex1);\n"
4911 " printf(\"Child (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4912 " fpost(futex2);\n"
4913 " }\n"
4914 "\\&\n"
4915 " exit(EXIT_SUCCESS);\n"
4916 " }\n"
4917 "\\&\n"
4918 " /* Le parent se retrouve ici. */\n"
4919 "\\&\n"
4920 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
4921 " fwait(futex2);\n"
4922 " printf(\"Parent (%jd) %u\\[rs]n\", (intmax_t) getpid(), j);\n"
4923 " fpost(futex1);\n"
4924 " }\n"
4925 "\\&\n"
4926 " wait(NULL);\n"
4927 "\\&\n"
4928 " exit(EXIT_SUCCESS);\n"
4929 "}\n"
4930
4931 #. type: TH
4932 #: opensuse-leap-16-1 opensuse-tumbleweed
4933 #, no-wrap
4934 msgid "Linux man-pages (unreleased)"
4935 msgstr "Pages du manuel de Linux (non publiées)"