Debian Codegraph @

po/ru/man2/membarrier.2.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # aereiae <[email protected]>, 2014.
5 # Alexey <[email protected]>, 2015.
6 # Azamat Hackimov <[email protected]>, 2013-2017.
7 # Dmitriy S. Seregin <[email protected]>, 2013.
8 # Dmitry Bolkhovskikh <[email protected]>, 2017.
9 # ITriskTI <[email protected]>, 2013.
10 # Max Is <[email protected]>, 2016.
11 # Yuri Kozlov <[email protected]>, 2011-2019.
12 # Иван Павлов <[email protected]>, 2017.
13 # Малянов Евгений Викторович <[email protected]>, 2014.
14 msgid ""
15 msgstr ""
16 "Project-Id-Version: manpages-l10n\n"
17 "POT-Creation-Date: 2026-06-05 06:30+0200\n"
18 "PO-Revision-Date: 2024-12-21 19:49+0300\n"
19 "Last-Translator: Yuri Kozlov <[email protected]>\n"
20 "Language-Team: Russian <[email protected]>\n"
21 "Language: ru\n"
22 "MIME-Version: 1.0\n"
23 "Content-Type: text/plain; charset=UTF-8\n"
24 "Content-Transfer-Encoding: 8bit\n"
25 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
26 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
27 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
28 "X-Generator: Lokalize 2.0\n"
29
30 #. type: TH
31 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
32 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
33 #, no-wrap
34 msgid "membarrier"
35 msgstr "membarrier"
36
37 #. type: TH
38 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
39 #: opensuse-tumbleweed
40 #, no-wrap
41 msgid "2025-09-21"
42 msgstr "21 сентября 2025 г."
43
44 #. type: TH
45 #: archlinux debian-unstable
46 #, fuzzy, no-wrap
47 #| msgid "Linux man-pages 6.17"
48 msgid "Linux man-pages 6.18"
49 msgstr "Справочные страницы Linux 6.17"
50
51 #. type: SH
52 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
53 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
54 #, no-wrap
55 msgid "NAME"
56 msgstr "НАИМЕНОВАНИЕ"
57
58 #. type: Plain text
59 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
60 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
61 msgid "membarrier - issue memory barriers on a set of threads"
62 msgstr "membarrier - задаёт барьеры памяти в наборе нитей"
63
64 #. type: SH
65 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
66 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
67 #, no-wrap
68 msgid "LIBRARY"
69 msgstr "БИБЛИОТЕКА"
70
71 #. type: Plain text
72 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
73 #: opensuse-leap-16-1 opensuse-tumbleweed
74 msgid "Standard C library (I<libc>,\\ I<-lc>)"
75 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
76
77 #. type: SH
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "SYNOPSIS"
82 msgstr "СИНТАКСИС"
83
84 #. type: Plain text
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 #, no-wrap
88 msgid ""
89 "B<#include E<lt>linux/membarrier.hE<gt>> /* Definition of B<MEMBARRIER_*> constants */\n"
90 "B<#include E<lt>sys/syscall.hE<gt>> /* Definition of B<SYS_*> constants */\n"
91 "B<#include E<lt>unistd.hE<gt>>\n"
92 msgstr ""
93 "B<#include E<lt>linux/membarrier.hE<gt>> /* определения констант B<MEMBARRIER_*> */\n"
94 "B<#include E<lt>sys/syscall.hE<gt>> /* определения констант B<SYS_*> */\n"
95 "B<#include E<lt>unistd.hE<gt>>\n"
96
97 #. type: Plain text
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, no-wrap
101 msgid "B<int syscall(SYS_membarrier, int >I<cmd>B<, unsigned int >I<flags>B<, int >I<cpu_id>B<);>\n"
102 msgstr "B<int syscall(SYS_membarrier, int >I<cmd>B<, unsigned int >I<flags>B<, int >I<cpu_id>B<);>\n"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid ""
108 "I<Note>: glibc provides no wrapper for B<membarrier>(), necessitating the "
109 "use of B<syscall>(2)."
110 msgstr ""
111
112 #. type: SH
113 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
114 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
115 #, no-wrap
116 msgid "DESCRIPTION"
117 msgstr "ОПИСАНИЕ"
118
119 #. type: Plain text
120 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
121 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
122 msgid ""
123 "The B<membarrier>() system call helps reducing the overhead of the memory "
124 "barrier instructions required to order memory accesses on multi-core "
125 "systems. However, this system call is heavier than a memory barrier, so "
126 "using it effectively is I<not> as simple as replacing memory barriers with "
127 "this system call, but requires understanding of the details below."
128 msgstr ""
129 "Системный вызов B<membarrier>() помогает сократить накладные расходы "
130 "инструкций барьера памяти, которые требуются при доступе к памяти в "
131 "многоядерных системах. Однако данный системный вызов затратнее чем барьер "
132 "памяти, поэтому чтобы использовать его эффективно I<недостаточно> просто "
133 "заменить им барьеры памяти, требуется понимание описанного далее."
134
135 #. type: Plain text
136 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
137 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
138 msgid ""
139 "Use of memory barriers needs to be done taking into account that a memory "
140 "barrier always needs to be either matched with its memory barrier "
141 "counterparts, or that the architecture's memory model doesn't require the "
142 "matching barriers."
143 msgstr ""
144 "При использовании барьеров памяти нужно принимать во внимание, что барьер "
145 "памяти всегда должен или иметь противоположную сторону барьера, или что "
146 "модель памяти архитектуры этого не требует."
147
148 #. type: Plain text
149 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
150 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
151 msgid ""
152 "There are cases where one side of the matching barriers (which we will refer "
153 "to as \"fast side\") is executed much more often than the other (which we "
154 "will refer to as \"slow side\"). This is a prime target for the use of "
155 "B<membarrier>(). The key idea is to replace, for these matching barriers, "
156 "the fast-side memory barriers by simple compiler barriers, for example:"
157 msgstr ""
158 "При работе бывает, что одна сторона барьера (которую будем называть «быстрой "
159 "стороной») применяется чаще чем другая (которую будем называть «медленной "
160 "стороной»). Это основная цель использования B<membarrier>(). Основная идея в "
161 "замене этих барьеров: быстрые стороны барьеров — простыми барьерами "
162 "компилятора:"
163
164 #. type: Plain text
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 #, no-wrap
168 msgid "asm volatile (\"\" : : : \"memory\")\n"
169 msgstr "asm volatile (\"\" : : : \"memory\")\n"
170
171 #. type: Plain text
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 msgid "and replace the slow-side memory barriers by calls to B<membarrier>()."
175 msgstr "а медленные стороны барьеров — вызовами B<membarrier>()."
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "This will add overhead to the slow side, and remove overhead from the fast "
182 "side, thus resulting in an overall performance increase as long as the slow "
183 "side is infrequent enough that the overhead of the B<membarrier>() calls "
184 "does not outweigh the performance gain on the fast side."
185 msgstr ""
186 "Это добавит накладных расходов к медленной стороне и удалит расходы у "
187 "быстрой стороны, что в результате повысит общую производительность в "
188 "зависимости от того, как часто используются вызовы B<membarrier>() у "
189 "медленной стороны, из-за которой возникают издержки, и не перевесит ли это "
190 "увеличение производительности быстрой стороны."
191
192 #. type: Plain text
193 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
194 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
195 msgid "The I<cmd> argument is one of the following:"
196 msgstr "Аргумент I<cmd> может принимать одно из следующих значений:"
197
198 #. type: TP
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 #, no-wrap
202 msgid "B<MEMBARRIER_CMD_QUERY> (since Linux 4.3)"
203 msgstr "B<MEMBARRIER_CMD_QUERY> (начиная с Linux 4.3)"
204
205 #. type: Plain text
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 msgid ""
209 "Query the set of supported commands. The return value of the call is a bit "
210 "mask of supported commands. B<MEMBARRIER_CMD_QUERY>, which has the value 0, "
211 "is not itself included in this bit mask. This command is always supported "
212 "(on kernels where B<membarrier>() is provided)."
213 msgstr ""
214 "Запросить набор поддерживаемых команд. Возвращаемое вызовом значение "
215 "представляет собой битовую маску поддерживаемых команд. Сама команда "
216 "B<MEMBARRIER_CMD_QUERY> имеет значение 0 и не включается в эту маску. Данная "
217 "команда поддерживается всегда (в ядрах с поддержкой B<membarrier>())."
218
219 #. type: TP
220 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
221 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
222 #, no-wrap
223 msgid "B<MEMBARRIER_CMD_GLOBAL> (since Linux 4.16)"
224 msgstr "B<MEMBARRIER_CMD_GLOBAL> (начиная с Linux 4.16)"
225
226 #. type: Plain text
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 msgid ""
230 "Ensure that all threads from all processes on the system pass through a "
231 "state where all memory accesses to user-space addresses match program order "
232 "between entry to and return from the B<membarrier>() system call. All "
233 "threads on the system are targeted by this command."
234 msgstr ""
235 "Проверить, что все потоки всех процессов в системе прошли через состояние, "
236 "где все доступы к памяти по адресам пространства пользователя соответствуют "
237 "программному порядку между входом и возвратом из системного вызова "
238 "B<membarrier>(). Все потоки в системе являются целью этой команды."
239
240 #. type: TP
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, no-wrap
244 msgid "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> (since Linux 4.16)"
245 msgstr "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> (начиная с Linux 4.16)"
246
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 msgid ""
251 "Execute a memory barrier on all running threads of all processes that "
252 "previously registered with B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
253 msgstr ""
254 "Установить барьер памяти во всех выполняющихся нитях всех процессов, которые "
255 "были ранее зарегистрированы с помощью "
256 "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
257
258 #. type: Plain text
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 msgid ""
262 "Upon return from the system call, the calling thread has a guarantee that "
263 "all running threads have passed through a state where all memory accesses to "
264 "user-space addresses match program order between entry to and return from "
265 "the system call (non-running threads are de facto in such a state). This "
266 "guarantee is provided only for the threads of processes that previously "
267 "registered with B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
268 msgstr ""
269 "После возврата из системного вызова вызвавшей нити гарантируется, что все "
270 "выполняющиеся нити прошли через состояние, где все доступы к памяти по "
271 "адресам пространства пользователя соответствуют программному порядку между "
272 "входом и возвратом из системного вызова (не выполняющиеся нити уже в таком "
273 "состоянии). Это гарантируется только для нитей процессов, которые были ранее "
274 "зарегистрированы с помощью B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
275
276 #. type: Plain text
277 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
278 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
279 msgid ""
280 "Given that registration is about the intent to receive the barriers, it is "
281 "valid to invoke B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> from a process that has "
282 "not employed B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
283 msgstr ""
284 "Учтите, что регистрация о намерении получать барьеры допускается вызовом "
285 "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> только из процесса, который не "
286 "использовал B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
287
288 #. type: Plain text
289 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
290 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
291 msgid ""
292 "The \"expedited\" commands complete faster than the non-expedited ones; they "
293 "never block, but have the downside of causing extra overhead."
294 msgstr ""
295 "«Курируемые» (expedited) команды выполняются быстрее чем не курируемые; они "
296 "никогда не блокируются, но на них приходятся дополнительные издержки."
297
298 #. type: TP
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 #, no-wrap
302 msgid "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED> (since Linux 4.16)"
303 msgstr "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED> (начиная с Linux 4.16)"
304
305 #. type: Plain text
306 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
307 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
308 msgid ""
309 "Register the process's intent to receive B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> "
310 "memory barriers."
311 msgstr ""
312 "Зарегистрировать намерение процесса получать барьеры памяти "
313 "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED>."
314
315 #. type: TP
316 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
317 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
318 #, no-wrap
319 msgid "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED> (since Linux 4.14)"
320 msgstr "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED> (начиная с Linux 4.14)"
321
322 #. type: Plain text
323 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
324 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
325 msgid ""
326 "Execute a memory barrier on each running thread belonging to the same "
327 "process as the calling thread."
328 msgstr ""
329 "Применить барьер памяти на все выполняющиеся нити, принадлежащие тому же "
330 "процессу, что и вызвавшая нить."
331
332 #. type: Plain text
333 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
334 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
335 msgid ""
336 "Upon return from the system call, the calling thread has a guarantee that "
337 "all its running thread siblings have passed through a state where all memory "
338 "accesses to user-space addresses match program order between entry to and "
339 "return from the system call (non-running threads are de facto in such a "
340 "state). This guarantee is provided only for threads in the same process as "
341 "the calling thread."
342 msgstr ""
343 "После возврата из системного вызова вызвавшей нити гарантируется, что все "
344 "выполняющиеся, одноуровневые с ней нити прошли через состояние, где все "
345 "доступы к памяти по адресам пространства пользователя соответствуют "
346 "программному порядку между входом и возвратом из системного вызова "
347 "(невыполняющиеся нити уже в таком состоянии). Это гарантируется только для "
348 "нитей того же процесса, что и вызвавшая нить."
349
350 #. type: Plain text
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 msgid ""
354 "A process must register its intent to use the private expedited command "
355 "prior to using it."
356 msgstr ""
357 "Процессу нужно регистрировать своё намерение использовать частную курируемую "
358 "команду до её использования."
359
360 #. type: TP
361 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
362 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
363 #, no-wrap
364 msgid "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED> (since Linux 4.14)"
365 msgstr "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED> (начиная с Linux 4.14)"
366
367 #. type: Plain text
368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
370 msgid ""
371 "Register the process's intent to use B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>."
372 msgstr ""
373 "Зарегистрировать намерение процесса использовать "
374 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>."
375
376 #. type: TP
377 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
378 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
379 #, no-wrap
380 msgid "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> (since Linux 4.16)"
381 msgstr "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> (начиная с Linux 4.16)"
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 "In addition to providing the memory ordering guarantees described in "
388 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, upon return from system call the "
389 "calling thread has a guarantee that all its running thread siblings have "
390 "executed a core serializing instruction. This guarantee is provided only "
391 "for threads in the same process as the calling thread."
392 msgstr ""
393 "В дополнении к гарантии упорядочивания памяти, описанной в "
394 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, после возврата из системного вызова "
395 "вызвавшей нити гарантируется, что все выполняющиеся, одноуровневые с ней "
396 "нити выполнили ядерную инструкцию сериализации (core serializing "
397 "instruction). Это гарантируется только для нитей того же процесса, что и "
398 "вызвавшая нить."
399
400 #. type: Plain text
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 msgid ""
404 "The \"expedited\" commands complete faster than the non-expedited ones, they "
405 "never block, but have the downside of causing extra overhead."
406 msgstr ""
407 "«Курируемые» (expedited) команды выполняются быстрее чем не курируемые; они "
408 "никогда не блокируются, но на них приходятся дополнительные издержки."
409
410 #. type: Plain text
411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
413 msgid ""
414 "A process must register its intent to use the private expedited sync core "
415 "command prior to using it."
416 msgstr ""
417 "Процессу нужно регистрировать своё намерение использовать частную курируемую "
418 "ядерную команду синхронизации до её использования."
419
420 #. type: TP
421 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
422 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
423 #, no-wrap
424 msgid "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> (since Linux 4.16)"
425 msgstr "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> (начиная с Linux 4.16)"
426
427 #. type: Plain text
428 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
429 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
430 msgid ""
431 "Register the process's intent to use "
432 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE>."
433 msgstr ""
434 "Зарегистрировать намерение процесса использовать "
435 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE>."
436
437 #. type: TP
438 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
439 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
440 #, no-wrap
441 msgid "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ> (since Linux 5.10)"
442 msgstr "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ> (начиная с Linux 5.10)"
443
444 #. type: Plain text
445 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
446 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
447 msgid ""
448 "Ensure the caller thread, upon return from system call, that all its running "
449 "thread siblings have any currently running rseq critical sections restarted "
450 "if I<flags> parameter is 0; if I<flags> parameter is "
451 "B<MEMBARRIER_CMD_FLAG_CPU>, then this operation is performed only on CPU "
452 "indicated by I<cpu_id>. This guarantee is provided only for threads in the "
453 "same process as the calling thread."
454 msgstr ""
455
456 #. type: Plain text
457 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
458 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
459 msgid "RSEQ membarrier is only available in the \"private expedited\" form."
460 msgstr ""
461
462 #. type: Plain text
463 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
464 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
465 #, fuzzy
466 #| msgid ""
467 #| "A process must register its intent to use the private expedited command "
468 #| "prior to using it."
469 msgid ""
470 "A process must register its intent to use the private expedited rseq command "
471 "prior to using it."
472 msgstr ""
473 "Процессу нужно регистрировать своё намерение использовать частную курируемую "
474 "команду до её использования."
475
476 #. type: TP
477 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
478 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
479 #, no-wrap
480 msgid "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ> (since Linux 5.10)"
481 msgstr "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ> (начиная с Linux 5.10)"
482
483 #. type: Plain text
484 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
485 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
486 msgid ""
487 "Register the process's intent to use "
488 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ>."
489 msgstr ""
490 "Зарегистрировать намерение процесса использовать "
491 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ>."
492
493 #. type: TP
494 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
495 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
496 #, no-wrap
497 msgid "B<MEMBARRIER_CMD_SHARED> (since Linux 4.3)"
498 msgstr "B<MEMBARRIER_CMD_SHARED> (начиная с Linux 4.3)"
499
500 #. type: Plain text
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 msgid ""
504 "This is an alias for B<MEMBARRIER_CMD_GLOBAL> that exists for header "
505 "backward compatibility."
506 msgstr ""
507 "Псевдоним B<MEMBARRIER_CMD_GLOBAL>, существует для обратной совместимости в "
508 "заголовке."
509
510 #. type: Plain text
511 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
512 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
513 msgid ""
514 "The I<flags> argument must be specified as 0 unless the command is "
515 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ>, in which case I<flags> can be "
516 "either 0 or B<MEMBARRIER_CMD_FLAG_CPU>."
517 msgstr ""
518
519 #. type: Plain text
520 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
521 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
522 msgid ""
523 "The I<cpu_id> argument is ignored unless I<flags> is "
524 "B<MEMBARRIER_CMD_FLAG_CPU>, in which case it must specify the CPU targeted "
525 "by this membarrier command."
526 msgstr ""
527
528 #. type: Plain text
529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
531 msgid ""
532 "All memory accesses performed in program order from each targeted thread are "
533 "guaranteed to be ordered with respect to B<membarrier>()."
534 msgstr ""
535 "Все доступы к памяти, выполняемые в программном порядке из каждого целевого "
536 "потока, гарантированно упорядочены в отношении B<membarrier>()."
537
538 #. type: Plain text
539 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
540 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
541 msgid ""
542 "If we use the semantic I<barrier()> to represent a compiler barrier forcing "
543 "memory accesses to be performed in program order across the barrier, and "
544 "I<smp_mb()> to represent explicit memory barriers forcing full memory "
545 "ordering across the barrier, we have the following ordering table for each "
546 "pairing of I<barrier()>, B<membarrier>(), and I<smp_mb()>. The pair "
547 "ordering is detailed as (O: ordered, X: not ordered):"
548 msgstr ""
549 "Если использовать семантику I<barrier()> для представления барьера "
550 "компилятора, обеспечивающего доступа к памяти, выполняемого в программном "
551 "порядке для пересечения барьера, и I<smp_mb()> — для представления явных "
552 "барьеров памяти, обеспечивающих полный упорядоченный доступ к памяти через "
553 "барьер, то получится следующая упорядочивающая таблица для каждой пары "
554 "I<barrier()>, B<membarrier>() и I<smp_mb()>. Наличие порядка в паре показано "
555 "знаком (O: упорядочено, X: не упорядочено):"
556
557 #. type: tbl table
558 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
559 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
560 #, no-wrap
561 msgid "barrier()"
562 msgstr "barrier()"
563
564 #. type: tbl table
565 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
566 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
567 #, no-wrap
568 msgid "smp_mb()"
569 msgstr "smp_mb()"
570
571 #. type: tbl table
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 #, no-wrap
575 msgid "membarrier()"
576 msgstr "membarrier()"
577
578 #. type: tbl table
579 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
580 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
581 #, no-wrap
582 msgid "X"
583 msgstr "X"
584
585 #. type: tbl table
586 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
587 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
588 #, no-wrap
589 msgid "O"
590 msgstr "O"
591
592 #. type: SH
593 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
594 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
595 #, no-wrap
596 msgid "RETURN VALUE"
597 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
598
599 #. type: Plain text
600 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
601 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
602 #, fuzzy
603 #| msgid ""
604 #| "On success, the B<MEMBARRIER_CMD_QUERY> operation returns a bit mask of "
605 #| "supported commands, and the B<MEMBARRIER_CMD_GLOBAL>, "
606 #| "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED>, "
607 #| "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>, "
608 #| "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, "
609 #| "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED>, "
610 #| "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE>, and "
611 #| "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> operations return "
612 #| "zero. On error, -1 is returned, and I<errno> is set appropriately."
613 msgid ""
614 "On success, the B<MEMBARRIER_CMD_QUERY> operation returns a bit mask of "
615 "supported commands, and the B<MEMBARRIER_CMD_GLOBAL>, "
616 "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED>, "
617 "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>, "
618 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, "
619 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED>, "
620 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE>, and "
621 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> operations return "
622 "zero. On error, -1 is returned, and I<errno> is set to indicate the error."
623 msgstr ""
624 "При успешном выполнении операции B<MEMBARRIER_CMD_QUERY> возвращается "
625 "битовая маска поддерживаемых команд, а операции B<MEMBARRIER_CMD_GLOBAL>, "
626 "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED>, "
627 "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>, "
628 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, "
629 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED>, "
630 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> и "
631 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> возвращают ноль. При "
632 "ошибке возвращается -1 и в I<errno> устанавливается соответствующее значение."
633
634 #. type: Plain text
635 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
636 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
637 msgid ""
638 "For a given command, with I<flags> set to 0, this system call is guaranteed "
639 "to always return the same value until reboot. Further calls with the same "
640 "arguments will lead to the same result. Therefore, with I<flags> set to 0, "
641 "error handling is required only for the first call to B<membarrier>()."
642 msgstr ""
643 "Для данной команды, если флаг I<flags> равен 0, то системный вызов всегда "
644 "гарантирует возврат одного и того же значения до перезагрузки. Последующие "
645 "вызовы с теми же аргументами всегда возвращают тот же результат. Поэтому, "
646 "если I<flags> равен 0, то обработка ошибок требуется только при первом "
647 "вызове B<membarrier>()."
648
649 #. type: SH
650 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
651 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
652 #, no-wrap
653 msgid "ERRORS"
654 msgstr "ОШИБКИ"
655
656 #. type: TP
657 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
658 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
659 #, no-wrap
660 msgid "B<EINVAL>"
661 msgstr "B<EINVAL>"
662
663 #. type: Plain text
664 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
665 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
666 msgid ""
667 "I<cmd> is invalid, or I<flags> is nonzero, or the B<MEMBARRIER_CMD_GLOBAL> "
668 "command is disabled because the I<nohz_full> CPU parameter has been set, or "
669 "the B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> and "
670 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> commands are not "
671 "implemented by the architecture."
672 msgstr ""
673 "Неверное значение I<cmd>, значение I<flags> не равно нулю, отключена команда "
674 "B<MEMBARRIER_CMD_GLOBAL>, так как указан параметр ЦП I<nohz_full> или "
675 "команды B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> "
676 "иB<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> не реализованы для "
677 "архитектуры."
678
679 #. type: TP
680 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
681 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
682 #, no-wrap
683 msgid "B<ENOSYS>"
684 msgstr "B<ENOSYS>"
685
686 #. type: Plain text
687 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
688 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
689 msgid "The B<membarrier>() system call is not implemented by this kernel."
690 msgstr "Системный вызов B<membarrier>() не реализован в данном ядре."
691
692 #. type: TP
693 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
694 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
695 #, no-wrap
696 msgid "B<EPERM>"
697 msgstr "B<EPERM>"
698
699 #. type: Plain text
700 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
701 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
702 msgid ""
703 "The current process was not registered prior to using private expedited "
704 "commands."
705 msgstr ""
706 "Текущий процесс не зарегистрирован до использования частных курируемых "
707 "команд."
708
709 #. type: SH
710 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
711 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
712 #, no-wrap
713 msgid "STANDARDS"
714 msgstr "СТАНДАРТЫ"
715
716 #. type: Plain text
717 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
718 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
719 msgid "Linux."
720 msgstr "Linux."
721
722 #. type: SH
723 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
724 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
725 #, no-wrap
726 msgid "HISTORY"
727 msgstr "ИСТОРИЯ"
728
729 #. type: Plain text
730 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
731 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
732 msgid "Linux 4.3."
733 msgstr "Linux 4.3."
734
735 #. type: Plain text
736 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
737 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
738 msgid "Before Linux 5.10, the prototype was:"
739 msgstr ""
740
741 #. type: Plain text
742 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
743 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
744 #, no-wrap
745 msgid "B<int membarrier(int >I<cmd>B<, int >I<flags>B<);>\n"
746 msgstr "B<int membarrier(int >I<cmd>B<, int >I<flags>B<);>\n"
747
748 #. type: SH
749 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
750 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
751 #, no-wrap
752 msgid "NOTES"
753 msgstr "ПРИМЕЧАНИЯ"
754
755 #. type: Plain text
756 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
757 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
758 msgid ""
759 "A memory barrier instruction is part of the instruction set of architectures "
760 "with weakly ordered memory models. It orders memory accesses prior to the "
761 "barrier and after the barrier with respect to matching barriers on other "
762 "cores. For instance, a load fence can order loads prior to and following "
763 "that fence with respect to stores ordered by store fences."
764 msgstr ""
765 "Инструкция барьера памяти является частью системы команд архитектуры со "
766 "слабо упорядоченными моделями памяти. Она упорядочивает доступ к памяти до "
767 "барьера и после барьера в соответствии совпадающими барьерами на других "
768 "ядрах. Например, загрузка барьера (fence) может упорядочить загрузку до и "
769 "после этого барьера в соответствии порядком хранилища, установленного "
770 "барьерами хранилища."
771
772 #. type: Plain text
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 msgid ""
776 "Program order is the order in which instructions are ordered in the program "
777 "assembly code."
778 msgstr ""
779 "Программный порядок — это порядок, в котором инструкции упорядочены в "
780 "ассемблерном коде программы."
781
782 #. type: Plain text
783 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
784 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
785 msgid ""
786 "Examples where B<membarrier>() can be useful include implementations of "
787 "Read-Copy-Update libraries and garbage collectors."
788 msgstr ""
789 "Вызов B<membarrier>() может быть полезным для реализации библиотек чтения-"
790 "копирования-обновления или сборщиков мусора."
791
792 #. type: SH
793 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
794 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
795 #, no-wrap
796 msgid "EXAMPLES"
797 msgstr "ПРИМЕРЫ"
798
799 #. type: Plain text
800 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
801 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
802 msgid ""
803 "Assuming a multithreaded application where \"fast_path()\" is executed very "
804 "frequently, and where \"slow_path()\" is executed infrequently, the "
805 "following code (x86) can be transformed using B<membarrier>():"
806 msgstr ""
807 "Предполагая, что в многонитевой программе «fast_path()» выполняется очень "
808 "часто, а «slow_path()» — редко, следующий код (x86) можно преобразовать "
809 "используя B<membarrier>():"
810
811 #. type: Plain text
812 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
813 #: opensuse-tumbleweed
814 #, no-wrap
815 msgid ""
816 "#include E<lt>stdlib.hE<gt>\n"
817 "\\&\n"
818 "static volatile int a, b;\n"
819 "\\&\n"
820 "static void\n"
821 "fast_path(int *read_b)\n"
822 "{\n"
823 " a = 1;\n"
824 " asm volatile (\"mfence\" : : : \"memory\");\n"
825 " *read_b = b;\n"
826 "}\n"
827 "\\&\n"
828 "static void\n"
829 "slow_path(int *read_a)\n"
830 "{\n"
831 " b = 1;\n"
832 " asm volatile (\"mfence\" : : : \"memory\");\n"
833 " *read_a = a;\n"
834 "}\n"
835 "\\&\n"
836 "int\n"
837 "main(void)\n"
838 "{\n"
839 " int read_a, read_b;\n"
840 "\\&\n"
841 " /*\n"
842 " * Real applications would call fast_path() and slow_path()\n"
843 " * from different threads. Call those from main() to keep\n"
844 " * this example short.\n"
845 " */\n"
846 "\\&\n"
847 " slow_path(&read_a);\n"
848 " fast_path(&read_b);\n"
849 "\\&\n"
850 " /*\n"
851 " * read_b == 0 implies read_a == 1 and\n"
852 " * read_a == 0 implies read_b == 1.\n"
853 " */\n"
854 "\\&\n"
855 " if (read_b == 0 && read_a == 0)\n"
856 " abort();\n"
857 "\\&\n"
858 " exit(EXIT_SUCCESS);\n"
859 "}\n"
860 msgstr ""
861
862 #. type: Plain text
863 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
864 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
865 msgid "The code above transformed to use B<membarrier>() becomes:"
866 msgstr "Этот же код, переписанный с использованием B<membarrier>():"
867
868 #. type: Plain text
869 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
870 #: opensuse-tumbleweed
871 #, no-wrap
872 msgid ""
873 "#define _GNU_SOURCE\n"
874 "#include E<lt>stdlib.hE<gt>\n"
875 "#include E<lt>stdio.hE<gt>\n"
876 "#include E<lt>unistd.hE<gt>\n"
877 "#include E<lt>sys/syscall.hE<gt>\n"
878 "#include E<lt>linux/membarrier.hE<gt>\n"
879 "\\&\n"
880 "static volatile int a, b;\n"
881 "\\&\n"
882 "static int\n"
883 "membarrier(int cmd, unsigned int flags, int cpu_id)\n"
884 "{\n"
885 " return syscall(__NR_membarrier, cmd, flags, cpu_id);\n"
886 "}\n"
887 "\\&\n"
888 "static int\n"
889 "init_membarrier(void)\n"
890 "{\n"
891 " int ret;\n"
892 "\\&\n"
893 " /* Check that membarrier() is supported. */\n"
894 "\\&\n"
895 " ret = membarrier(MEMBARRIER_CMD_QUERY, 0, 0);\n"
896 " if (ret E<lt> 0) {\n"
897 " perror(\"membarrier\");\n"
898 " return -1;\n"
899 " }\n"
900 "\\&\n"
901 " if (!(ret & MEMBARRIER_CMD_GLOBAL)) {\n"
902 " fprintf(stderr,\n"
903 " \"membarrier does not support MEMBARRIER_CMD_GLOBAL\\[rs]n\");\n"
904 " return -1;\n"
905 " }\n"
906 "\\&\n"
907 " return 0;\n"
908 "}\n"
909 "\\&\n"
910 "static void\n"
911 "fast_path(int *read_b)\n"
912 "{\n"
913 " a = 1;\n"
914 " asm volatile (\"\" : : : \"memory\");\n"
915 " *read_b = b;\n"
916 "}\n"
917 "\\&\n"
918 "static void\n"
919 "slow_path(int *read_a)\n"
920 "{\n"
921 " b = 1;\n"
922 " membarrier(MEMBARRIER_CMD_GLOBAL, 0, 0);\n"
923 " *read_a = a;\n"
924 "}\n"
925 "\\&\n"
926 "int\n"
927 "main(int argc, char *argv[])\n"
928 "{\n"
929 " int read_a, read_b;\n"
930 "\\&\n"
931 " if (init_membarrier())\n"
932 " exit(EXIT_FAILURE);\n"
933 "\\&\n"
934 " /*\n"
935 " * Real applications would call fast_path() and slow_path()\n"
936 " * from different threads. Call those from main() to keep\n"
937 " * this example short.\n"
938 " */\n"
939 "\\&\n"
940 " slow_path(&read_a);\n"
941 " fast_path(&read_b);\n"
942 "\\&\n"
943 " /*\n"
944 " * read_b == 0 implies read_a == 1 and\n"
945 " * read_a == 0 implies read_b == 1.\n"
946 " */\n"
947 "\\&\n"
948 " if (read_b == 0 && read_a == 0)\n"
949 " abort();\n"
950 "\\&\n"
951 " exit(EXIT_SUCCESS);\n"
952 "}\n"
953 msgstr ""
954
955 #. type: TH
956 #: debian-trixie
957 #, no-wrap
958 msgid "2024-06-15"
959 msgstr "15 июня 2024 г."
960
961 #. type: TH
962 #: debian-trixie
963 #, no-wrap
964 msgid "Linux man-pages 6.9.1"
965 msgstr "Страницы руководства Linux 6.9.1"
966
967 #. type: Plain text
968 #: debian-trixie
969 msgid "Standard C library (I<libc>, I<-lc>)"
970 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
971
972 #. type: Plain text
973 #: debian-trixie fedora-44 fedora-rawhide
974 #, no-wrap
975 msgid ""
976 "#include E<lt>stdlib.hE<gt>\n"
977 "\\&\n"
978 "static volatile int a, b;\n"
979 "\\&\n"
980 "static void\n"
981 "fast_path(int *read_b)\n"
982 "{\n"
983 " a = 1;\n"
984 " asm volatile (\"mfence\" : : : \"memory\");\n"
985 " *read_b = b;\n"
986 "}\n"
987 "\\&\n"
988 "static void\n"
989 "slow_path(int *read_a)\n"
990 "{\n"
991 " b = 1;\n"
992 " asm volatile (\"mfence\" : : : \"memory\");\n"
993 " *read_a = a;\n"
994 "}\n"
995 "\\&\n"
996 "int\n"
997 "main(void)\n"
998 "{\n"
999 " int read_a, read_b;\n"
1000 "\\&\n"
1001 " /*\n"
1002 " * Real applications would call fast_path() and slow_path()\n"
1003 " * from different threads. Call those from main() to keep\n"
1004 " * this example short.\n"
1005 " */\n"
1006 "\\&\n"
1007 " slow_path(&read_a);\n"
1008 " fast_path(&read_b);\n"
1009 "\\&\n"
1010 " /*\n"
1011 " * read_b == 0 implies read_a == 1 and\n"
1012 " * read_a == 0 implies read_b == 1.\n"
1013 " */\n"
1014 "\\&\n"
1015 " if (read_b == 0 && read_a == 0)\n"
1016 " abort();\n"
1017 "\\&\n"
1018 " exit(EXIT_SUCCESS);\n"
1019 "}\n"
1020 msgstr ""
1021
1022 #. type: Plain text
1023 #: debian-trixie fedora-44 fedora-rawhide
1024 #, no-wrap
1025 msgid ""
1026 "#define _GNU_SOURCE\n"
1027 "#include E<lt>stdlib.hE<gt>\n"
1028 "#include E<lt>stdio.hE<gt>\n"
1029 "#include E<lt>unistd.hE<gt>\n"
1030 "#include E<lt>sys/syscall.hE<gt>\n"
1031 "#include E<lt>linux/membarrier.hE<gt>\n"
1032 "\\&\n"
1033 "static volatile int a, b;\n"
1034 "\\&\n"
1035 "static int\n"
1036 "membarrier(int cmd, unsigned int flags, int cpu_id)\n"
1037 "{\n"
1038 " return syscall(__NR_membarrier, cmd, flags, cpu_id);\n"
1039 "}\n"
1040 "\\&\n"
1041 "static int\n"
1042 "init_membarrier(void)\n"
1043 "{\n"
1044 " int ret;\n"
1045 "\\&\n"
1046 " /* Check that membarrier() is supported. */\n"
1047 "\\&\n"
1048 " ret = membarrier(MEMBARRIER_CMD_QUERY, 0, 0);\n"
1049 " if (ret E<lt> 0) {\n"
1050 " perror(\"membarrier\");\n"
1051 " return -1;\n"
1052 " }\n"
1053 "\\&\n"
1054 " if (!(ret & MEMBARRIER_CMD_GLOBAL)) {\n"
1055 " fprintf(stderr,\n"
1056 " \"membarrier does not support MEMBARRIER_CMD_GLOBAL\\[rs]n\");\n"
1057 " return -1;\n"
1058 " }\n"
1059 "\\&\n"
1060 " return 0;\n"
1061 "}\n"
1062 "\\&\n"
1063 "static void\n"
1064 "fast_path(int *read_b)\n"
1065 "{\n"
1066 " a = 1;\n"
1067 " asm volatile (\"\" : : : \"memory\");\n"
1068 " *read_b = b;\n"
1069 "}\n"
1070 "\\&\n"
1071 "static void\n"
1072 "slow_path(int *read_a)\n"
1073 "{\n"
1074 " b = 1;\n"
1075 " membarrier(MEMBARRIER_CMD_GLOBAL, 0, 0);\n"
1076 " *read_a = a;\n"
1077 "}\n"
1078 "\\&\n"
1079 "int\n"
1080 "main(int argc, char *argv[])\n"
1081 "{\n"
1082 " int read_a, read_b;\n"
1083 "\\&\n"
1084 " if (init_membarrier())\n"
1085 " exit(EXIT_FAILURE);\n"
1086 "\\&\n"
1087 " /*\n"
1088 " * Real applications would call fast_path() and slow_path()\n"
1089 " * from different threads. Call those from main() to keep\n"
1090 " * this example short.\n"
1091 " */\n"
1092 "\\&\n"
1093 " slow_path(&read_a);\n"
1094 " fast_path(&read_b);\n"
1095 "\\&\n"
1096 " /*\n"
1097 " * read_b == 0 implies read_a == 1 and\n"
1098 " * read_a == 0 implies read_b == 1.\n"
1099 " */\n"
1100 "\\&\n"
1101 " if (read_b == 0 && read_a == 0)\n"
1102 " abort();\n"
1103 "\\&\n"
1104 " exit(EXIT_SUCCESS);\n"
1105 "}\n"
1106 msgstr ""
1107
1108 #. type: TH
1109 #: fedora-44 fedora-rawhide
1110 #, no-wrap
1111 msgid "2024-07-23"
1112 msgstr "23 июля 2024 г."
1113
1114 #. type: TH
1115 #: fedora-44 fedora-rawhide
1116 #, no-wrap
1117 msgid "Linux man-pages 6.13"
1118 msgstr "Страницы руководства Linux 6.13"
1119
1120 #. type: TH
1121 #: mageia-cauldron
1122 #, no-wrap
1123 msgid "Linux man-pages 6.17"
1124 msgstr "Страницы руководства Linux 6.17"
1125
1126 #. type: TH
1127 #: opensuse-leap-16-1 opensuse-tumbleweed
1128 #, no-wrap
1129 msgid "Linux man-pages (unreleased)"
1130 msgstr "Страницы руководства Linux (не выпущены)"