Units
Translation components API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/translations/documentation/booksarch-handbooksmp_index/ru/units/?format=api&page=2
{ "count": 156, "next": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/units/?format=api&page=3", "previous": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/units/?format=api", "results": [ { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Specific Locking Strategies" ], "previous_source": "", "target": [ "Конкретные стратегии блокировки" ], "id_hash": -1962114833621526533, "content_hash": -1962114833621526533, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:154", "context": "", "note": "type: Title ==", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 51, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1134262/?format=api", "priority": 100, "id": 1811695, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=64c52af45d76d7fb", "url": "https://translate-dev.freebsd.org/api/units/1811695/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.222162Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Credentials" ], "previous_source": "", "target": [ "Учётные данные" ], "id_hash": 181406758642361756, "content_hash": 181406758642361756, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:156", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 52, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134264/?format=api", "priority": 100, "id": 1811696, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=82847c7c60bba59c", "url": "https://translate-dev.freebsd.org/api/units/1811696/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.222759Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "`struct ucred` is the kernel's internal credential structure, and is generally used as the basis for process-driven access control within the kernel. BSD-derived systems use a \"copy-on-write\" model for credential data: multiple references may exist for a credential structure, and when a change needs to be made, the structure is duplicated, modified, and then the reference replaced. Due to wide-spread caching of the credential to implement access control on open, this results in substantial memory savings. With a move to fine-grained SMP, this model also saves substantially on locking operations by requiring that modification only occur on an unshared credential, avoiding the need for explicit synchronization when consuming a known-shared credential." ], "previous_source": "", "target": [ "`struct ucred` — это внутренняя структура учётных данных ядра, которая обычно используется в качестве основы для управления доступом на уровне процессов внутри ядра. Системы, производные от BSD, используют модель «копирования при записи» для учётных данных: могут существовать множественные ссылки на структуру учётных данных, и когда требуется внести изменение, структура дублируется, изменяется, а затем ссылка заменяется. Благодаря широко распространённому кэшированию учётных данных для реализации контроля доступа при открытии, это приводит к значительной экономии памяти. С переходом на детализированную SMP (симметричную многопроцессорность), эта модель также существенно экономит на операциях блокировки, требуя, чтобы модификации выполнялись только для неразделяемых учётных данных, избегая необходимости явной синхронизации при использовании известных разделяемых учётных данных." ], "id_hash": -8862976827597105351, "content_hash": -8862976827597105351, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:159", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 53, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 111, "source_unit": "https://translate-dev.freebsd.org/api/units/1134266/?format=api", "priority": 100, "id": 1811697, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=050061888a8e5739", "url": "https://translate-dev.freebsd.org/api/units/1811697/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.223341Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Credential structures with a single reference are considered mutable; shared credential structures must not be modified or a race condition is risked. A mutex, `cr_mtxp` protects the reference count of `struct ucred` so as to maintain consistency. Any use of the structure requires a valid reference for the duration of the use, or the structure may be released out from under the illegitimate consumer." ], "previous_source": "", "target": [ "Структуры учётных данных с единственной ссылкой считаются изменяемыми; разделяемые структуры учётных данных не должны изменяться, иначе возникает риск состояния гонки. Мьютекс `cr_mtxp` защищает счетчик ссылок структуры `struct ucred` для поддержания согласованности. Любое использование структуры требует действительной ссылки на протяжении всего времени использования, иначе структура может быть освобождена из-под нелегитимного потребителя." ], "id_hash": 4782467227970370357, "content_hash": 4782467227970370357, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:161", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 54, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 64, "source_unit": "https://translate-dev.freebsd.org/api/units/1134268/?format=api", "priority": 100, "id": 1811698, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=c25ebc9af11efb35", "url": "https://translate-dev.freebsd.org/api/units/1811698/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.223999Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The `struct ucred` mutex is a leaf mutex and is implemented via a mutex pool for performance reasons." ], "previous_source": "", "target": [ "Мьютекс `struct ucred` является листовым мьютексом и реализован через пул мьютексов по соображениям производительности." ], "id_hash": 70324799552655513, "content_hash": 70324799552655513, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:163", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 55, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 18, "source_unit": "https://translate-dev.freebsd.org/api/units/1134270/?format=api", "priority": 100, "id": 1811699, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=80f9d808583c9099", "url": "https://translate-dev.freebsd.org/api/units/1811699/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.224640Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Usually, credentials are used in a read-only manner for access control decisions, and in this case `td_ucred` is generally preferred because it requires no locking. When a process' credential is updated the `proc` lock must be held across the check and update operations thus avoid races. The process credential `p_ucred` must be used for check and update operations to prevent time-of-check, time-of-use races." ], "previous_source": "", "target": [ "Обычно учётные данные используются в режиме только для чтения для принятия решений по контролю доступа, и в этом случае `td_ucred`, как правило, предпочтительнее, поскольку не требует блокировки. Когда учётные данные процесса обновляются, блокировка `proc` должна удерживаться на протяжении операций проверки и обновления, чтобы избежать состояний гонки. Учётные данные процесса `p_ucred` должны использоваться для операций проверки и обновления, чтобы предотвратить гонки между временем проверки и временем использования." ], "id_hash": -733503318545727327, "content_hash": -733503318545727327, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:165", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 56, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 63, "source_unit": "https://translate-dev.freebsd.org/api/units/1134272/?format=api", "priority": 100, "id": 1811700, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=75d2129e388300a1", "url": "https://translate-dev.freebsd.org/api/units/1811700/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.225217Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "If system call invocations will perform access control after an update to the process credential, the value of `td_ucred` must also be refreshed to the current process value. This will prevent use of a stale credential following a change. The kernel automatically refreshes the `td_ucred` pointer in the thread structure from the process `p_ucred` whenever a process enters the kernel, permitting use of a fresh credential for kernel access control." ], "previous_source": "", "target": [ "Если при системных вызовах будет выполняться контроль доступа после обновления учётных данных процесса, значение `td_ucred` также должно быть обновлено до текущего значения процесса. Это предотвратит использование устаревших учётных данных после изменения. Ядро автоматически обновляет указатель `td_ucred` в структуре потока из `p_ucred` процесса всякий раз, когда процесс входит в ядро, что позволяет использовать свежие учётные данные для контроля доступа в ядре." ], "id_hash": 3378990868534647717, "content_hash": 3378990868534647717, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:167", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 57, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 70, "source_unit": "https://translate-dev.freebsd.org/api/units/1134274/?format=api", "priority": 100, "id": 1811701, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=aee4964ad24bdba5", "url": "https://translate-dev.freebsd.org/api/units/1811701/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.225824Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "File Descriptors and File Descriptor Tables" ], "previous_source": "", "target": [ "Дескрипторы файлов и таблицы дескрипторов файлов" ], "id_hash": 3609989085346982098, "content_hash": 3609989085346982098, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:168", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 58, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 6, "source_unit": "https://translate-dev.freebsd.org/api/units/1134276/?format=api", "priority": 100, "id": 1811702, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b21941f25324e8d2", "url": "https://translate-dev.freebsd.org/api/units/1811702/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.226499Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Details to follow." ], "previous_source": "", "target": [ "Подробности будут позже." ], "id_hash": -9099776473031393328, "content_hash": -9099776473031393328, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:171", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 59, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1134278/?format=api", "priority": 100, "id": 1811703, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=01b71982ad81bfd0", "url": "https://translate-dev.freebsd.org/api/units/1811703/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.227051Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Jail Structures" ], "previous_source": "", "target": [ "Структуры клеток" ], "id_hash": 5167628290540269625, "content_hash": 5167628290540269625, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:172", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 60, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1134280/?format=api", "priority": 100, "id": 1811704, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=c7b71a8d0ce97039", "url": "https://translate-dev.freebsd.org/api/units/1811704/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.227589Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "`struct prison` stores administrative details pertinent to the maintenance of jails created using the man:jail[2] API. This includes the per-jail hostname, IP address, and related settings. This structure is reference-counted since pointers to instances of the structure are shared by many credential structures. A single mutex, `pr_mtx` protects read and write access to the reference count and all mutable variables inside the struct jail. Some variables are set only when the jail is created, and a valid reference to the `struct prison` is sufficient to read these values. The precise locking of each entry is documented via comments in [.filename]#sys/jail.h#." ], "previous_source": "", "target": [ "`struct prison` хранит административные данные, связанные с обслуживанием клеток, созданных с использованием API man:jail[2]. Это включает имя хоста для каждой клетки, IP-адрес и связанные настройки. Эта структура имеет счетчик ссылок, так как указатели на её экземпляры разделяются многими структурами учётных данных. Один мьютекс, `pr_mtx`, защищает чтение и запись счётчика ссылок и всех изменяемых переменных внутри `struct jail`. Некоторые переменные устанавливаются только при создании клетки, и действительной ссылки на `struct prison` достаточно для чтения этих значений. Точная блокировка каждой записи документирована в комментариях файла [.filename]#sys/jail.h#." ], "id_hash": -6404492257615091161, "content_hash": -6404492257615091161, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:175", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 61, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 100, "source_unit": "https://translate-dev.freebsd.org/api/units/1134282/?format=api", "priority": 100, "id": 1811705, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=271eac39621cea27", "url": "https://translate-dev.freebsd.org/api/units/1811705/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.228158Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "MAC Framework" ], "previous_source": "", "target": [ "MAC Framework" ], "id_hash": 8109534192808495021, "content_hash": 8109534192808495021, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:176", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 62, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1134284/?format=api", "priority": 100, "id": 1811706, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=f08ada61d83c07ad", "url": "https://translate-dev.freebsd.org/api/units/1811706/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.228821Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The TrustedBSD MAC Framework maintains data in a variety of kernel objects, in the form of `struct label`. In general, labels in kernel objects are protected by the same lock as the remainder of the kernel object. For example, the `v_label` label in `struct vnode` is protected by the vnode lock on the vnode." ], "previous_source": "", "target": [ "Фреймворк TrustedBSD MAC поддерживает данные в различных объектах ядра в виде `struct label`. Как правило, метки в объектах ядра защищаются тем же механизмом блокировки, что и остальная часть объекта ядра. Например, метка `v_label` в `struct vnode` защищается блокировкой vnode." ], "id_hash": -1817338020532525225, "content_hash": -1817338020532525225, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:179", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 63, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 54, "source_unit": "https://translate-dev.freebsd.org/api/units/1134286/?format=api", "priority": 100, "id": 1811707, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=66c784b2f158e757", "url": "https://translate-dev.freebsd.org/api/units/1811707/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.229368Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "In addition to labels maintained in standard kernel objects, the MAC Framework also maintains a list of registered and active policies. The policy list is protected by a global mutex (`mac_policy_list_lock`) and a busy count (also protected by the mutex). Since many access control checks may occur in parallel, entry to the framework for a read-only access to the policy list requires holding the mutex while incrementing (and later decrementing) the busy count. The mutex need not be held for the duration of the MAC entry operation--some operations, such as label operations on file system objects--are long-lived. To modify the policy list, such as during policy registration and de-registration, the mutex must be held and the reference count must be zero, to prevent modification of the list while it is in use." ], "previous_source": "", "target": [ "В дополнение к меткам, поддерживаемым в стандартных объектах ядра, MAC Framework также поддерживает список зарегистрированных и активных политик. Список политик защищен глобальной мьютекс-блокировкой (`mac_policy_list_lock`) и счетчиком использования (также защищенным мьютексом). Поскольку множество проверок контроля доступа может выполняться параллельно, вход в framework для доступа только на чтение к списку политик требует удержания мьютекса во время увеличения (и последующего уменьшения) счетчика использования. Мьютекс не обязательно удерживать на протяжении всей операции входа в MAC — некоторые операции, такие как операции с метками на объектах файловой системы, выполняются длительное время. Для изменения списка политик, например во время регистрации и отмены регистрации политик, мьютекс должен быть удержан, а счетчик ссылок должен быть равен нулю, чтобы предотвратить изменение списка во время его использования." ], "id_hash": -8104494576613012656, "content_hash": -8104494576613012656, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:181", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 64, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 132, "source_unit": "https://translate-dev.freebsd.org/api/units/1134288/?format=api", "priority": 100, "id": 1811708, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=0f870d1f3ce6cb50", "url": "https://translate-dev.freebsd.org/api/units/1811708/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.229964Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "A condition variable, `mac_policy_list_not_busy`, is available to threads that need to wait for the list to become unbusy, but this condition variable must only be waited on if the caller is holding no other locks, or a lock order violation may be possible. The busy count, in effect, acts as a form of shared/exclusive lock over access to the framework: the difference is that, unlike with an sx lock, consumers waiting for the list to become unbusy may be starved, rather than permitting lock order problems with regards to the busy count and other locks that may be held on entry to (or inside) the MAC Framework." ], "previous_source": "", "target": [ "Условная переменная `mac_policy_list_not_busy` доступна для потоков, которым необходимо дождаться освобождения списка, но ожидание на этой условной переменной допустимо только если вызывающий поток не удерживает других блокировок, иначе может возникнуть нарушение порядка блокировок. Фактически, счетчик занятости действует как форма разделяемой/исключающей блокировки доступа к фреймворку: отличие в том, что, в отличие от sx-блокировки, потребители, ожидающие освобождения списка, могут подвергаться голоданию, вместо того чтобы допускать проблемы порядка блокировок в отношении счетчика занятости и других блокировок, которые могут удерживаться при входе в (или внутри) MAC Framework." ], "id_hash": 4935148307727889910, "content_hash": 4935148307727889910, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:183", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 65, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 107, "source_unit": "https://translate-dev.freebsd.org/api/units/1134290/?format=api", "priority": 100, "id": 1811709, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=c47d2b3d03fdb5f6", "url": "https://translate-dev.freebsd.org/api/units/1811709/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.230642Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Modules" ], "previous_source": "", "target": [ "Модули" ], "id_hash": 5765707394953988832, "content_hash": 5765707394953988832, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:184", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 66, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134292/?format=api", "priority": 100, "id": 1811710, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=d003e853e3134ae0", "url": "https://translate-dev.freebsd.org/api/units/1811710/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.231276Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "For the module subsystem there exists a single lock that is used to protect the shared data. This lock is a shared/exclusive (SX) lock and has a good chance of needing to be acquired (shared or exclusively), therefore there are a few macros that have been added to make access to the lock more easy. These macros can be located in [.filename]#sys/module.h# and are quite basic in terms of usage. The main structures protected under this lock are the `module_t` structures (when shared) and the global `modulelist_t` structure, modules. One should review the related source code in [.filename]#kern/kern_module.c# to further understand the locking strategy." ], "previous_source": "", "target": [ "Для подсистемы модулей существует единая блокировка, которая используется для защиты общих данных. Эта блокировка является shared/exclusive (SX) и с высокой вероятностью потребует захвата (разделяемого или исключительного), поэтому были добавлены несколько макросов для упрощения работы с ней. Эти макросы можно найти в [.filename]#sys/module.h#, и их использование довольно простое. Основные структуры, защищаемые этой блокировкой, — это структуры `module_t` (при разделяемом доступе) и глобальная структура `modulelist_t` modules. Для более глубокого понимания стратегии блокировок рекомендуется изучить соответствующий исходный код в [.filename]#kern/kern_module.c#." ], "id_hash": -6678660089187176600, "content_hash": -6678660089187176600, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:187", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 67, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 104, "source_unit": "https://translate-dev.freebsd.org/api/units/1134294/?format=api", "priority": 100, "id": 1811711, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=2350a208b06b6f68", "url": "https://translate-dev.freebsd.org/api/units/1811711/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.231859Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Newbus Device Tree" ], "previous_source": "", "target": [ "Дерево устройств Newbus" ], "id_hash": -1973000544175501977, "content_hash": -1973000544175501977, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:188", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 68, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1134296/?format=api", "priority": 100, "id": 1811712, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=649e7e755ec44d67", "url": "https://translate-dev.freebsd.org/api/units/1811712/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.232582Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The newbus system will have one sx lock. Readers will hold a shared (read) lock (man:sx_slock[9]) and writers will hold an exclusive (write) lock (man:sx_xlock[9]). Internal functions will not do locking at all. Externally visible ones will lock as needed. Those items that do not matter if the race is won or lost will not be locked, since they tend to be read all over the place (e.g., man:device_get_softc[9]). There will be relatively few changes to the newbus data structures, so a single lock should be sufficient and not impose a performance penalty." ], "previous_source": "", "target": [ "Система newbus будет использовать одну блокировку sx. Читатели будут удерживать разделяемую (read) блокировку (man:sx_slock[9]), а писатели — эксклюзивную (write) блокировку (man:sx_xlock[9]). Внутренние функции не будут выполнять блокировку вообще. Внешне видимые функции будут блокироваться по мере необходимости. Элементы, для которых не важно, выиграна гонка или проиграна, не будут блокироваться, так как они обычно читаются во многих местах (например, man:device_get_softc[9]). Изменения в структурах данных newbus будут относительно редкими, поэтому одной блокировки должно быть достаточно, и это не приведёт к снижению производительности." ], "id_hash": -3822874220961291611, "content_hash": -3822874220961291611, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:191", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 69, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 93, "source_unit": "https://translate-dev.freebsd.org/api/units/1134298/?format=api", "priority": 100, "id": 1811713, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=4af26c26869aa2a5", "url": "https://translate-dev.freebsd.org/api/units/1811713/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.233150Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Pipes" ], "previous_source": "", "target": [ "Каналы (pipe)" ], "id_hash": 7460971869621122550, "content_hash": 7460971869621122550, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:192", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 70, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134300/?format=api", "priority": 100, "id": 1811714, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=e78ab262aff2f5f6", "url": "https://translate-dev.freebsd.org/api/units/1811714/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.233804Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "..." ], "previous_source": "", "target": [ "..." ], "id_hash": 9041744916878268179, "content_hash": 9041744916878268179, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:195, documentation/content/en/books/arch-handbook/smp/_index.adoc:217", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 71, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134302/?format=api", "priority": 100, "id": 1811715, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=fd7abb18c0391713", "url": "https://translate-dev.freebsd.org/api/units/1811715/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.234349Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Processes and Threads" ], "previous_source": "", "target": [ "Процессы и потоки" ], "id_hash": -6329115037863804152, "content_hash": -6329115037863804152, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:196", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 72, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1134304/?format=api", "priority": 100, "id": 1811716, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=282a7767f98b8308", "url": "https://translate-dev.freebsd.org/api/units/1811716/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.234898Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "process hierarchy" ], "previous_source": "", "target": [ "иерархия процессов" ], "id_hash": 8392076889156678156, "content_hash": 8392076889156678156, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:199", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 73, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1134306/?format=api", "priority": 100, "id": 1811717, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=f476a577b1f2f20c", "url": "https://translate-dev.freebsd.org/api/units/1811717/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.235453Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "proc locks, references" ], "previous_source": "", "target": [ "блокировки и ссылки proc" ], "id_hash": 8978972421942272818, "content_hash": 8978972421942272818, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:201", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 74, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1134308/?format=api", "priority": 100, "id": 1811718, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=fc9bb7d859e5e332", "url": "https://translate-dev.freebsd.org/api/units/1811718/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.235985Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "thread-specific copies of proc entries to freeze during system calls, including td_ucred" ], "previous_source": "", "target": [ "потокоспецифичные копии записей proc для заморозки во время системных вызовов, включая td_ucred" ], "id_hash": 6114200729519518473, "content_hash": 6114200729519518473, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:203", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 75, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 12, "source_unit": "https://translate-dev.freebsd.org/api/units/1134310/?format=api", "priority": 100, "id": 1811719, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=d4da012b4871f309", "url": "https://translate-dev.freebsd.org/api/units/1811719/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.236586Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "inter-process operations" ], "previous_source": "", "target": [ "межпроцессные операции" ], "id_hash": 8879113458512934865, "content_hash": 8879113458512934865, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:205", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 76, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1134312/?format=api", "priority": 100, "id": 1811720, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=fb38f2a59f0db7d1", "url": "https://translate-dev.freebsd.org/api/units/1811720/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.237154Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "process groups and sessions" ], "previous_source": "", "target": [ "группы процессов и сеансы" ], "id_hash": -7498593416543012143, "content_hash": -7498593416543012143, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:207", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 77, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 4, "source_unit": "https://translate-dev.freebsd.org/api/units/1134314/?format=api", "priority": 100, "id": 1811721, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=17efa50453defad1", "url": "https://translate-dev.freebsd.org/api/units/1811721/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.237691Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Scheduler" ], "previous_source": "", "target": [ "Планировщик" ], "id_hash": -288499761401529233, "content_hash": -288499761401529233, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:208", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 78, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134316/?format=api", "priority": 100, "id": 1811722, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=7bff0afedbe07c6f", "url": "https://translate-dev.freebsd.org/api/units/1811722/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.238251Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Lots of references to `sched_lock` and notes pointing at specific primitives and related magic elsewhere in the document." ], "previous_source": "", "target": [ "Множество ссылок на `sched_lock` и примечания, указывающие на конкретные примитивы и связанные с ними особенности в других частях документа." ], "id_hash": 3039462004251672715, "content_hash": 3039462004251672715, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:211", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 79, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 18, "source_unit": "https://translate-dev.freebsd.org/api/units/1134318/?format=api", "priority": 100, "id": 1811723, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=aa2e5696cfb7c08b", "url": "https://translate-dev.freebsd.org/api/units/1811723/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.238793Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Select and Poll" ], "previous_source": "", "target": [ "Select и Poll" ], "id_hash": 8869789562332201898, "content_hash": 8869789562332201898, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:212", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 80, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1134320/?format=api", "priority": 100, "id": 1811724, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=fb17d29cdf4743aa", "url": "https://translate-dev.freebsd.org/api/units/1811724/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.239342Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The `select` and `poll` functions permit threads to block waiting on events on file descriptors--most frequently, whether or not the file descriptors are readable or writable." ], "previous_source": "", "target": [ "Функции `select` и `poll` позволяют потокам блокироваться в ожидании событий на файловых дескрипторах — чаще всего, доступности файловых дескрипторов для чтения или записи." ], "id_hash": 6336212116685322900, "content_hash": 6336212116685322900, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:215", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 81, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 26, "source_unit": "https://translate-dev.freebsd.org/api/units/1134322/?format=api", "priority": 100, "id": 1811725, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=d7eebf59748dfa94", "url": "https://translate-dev.freebsd.org/api/units/1811725/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.239904Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "SIGIO" ], "previous_source": "", "target": [ "SIGIO" ], "id_hash": -4497599226076596110, "content_hash": -4497599226076596110, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:218", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 82, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134324/?format=api", "priority": 100, "id": 1811726, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=419551554ba1f872", "url": "https://translate-dev.freebsd.org/api/units/1811726/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.240489Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The SIGIO service permits processes to request the delivery of a SIGIO signal to its process group when the read/write status of specified file descriptors changes. At most one process or process group is permitted to register for SIGIO from any given kernel object, and that process or group is referred to as the owner. Each object supporting SIGIO registration contains pointer field that is `NULL` if the object is not registered, or points to a `struct sigio` describing the registration. This field is protected by a global mutex, `sigio_lock`. Callers to SIGIO maintenance functions must pass in this field \"by reference\" so that local register copies of the field are not made when unprotected by the lock." ], "previous_source": "", "target": [ "Служба SIGIO позволяет процессам запрашивать доставку сигнала SIGIO своей группе процессов при изменении статуса чтения/записи указанных файловых дескрипторов. Не более одного процесса или группы процессов может зарегистрироваться для получения SIGIO от любого заданного объекта ядра, и такой процесс или группа называется владельцем. Каждый объект, поддерживающий регистрацию SIGIO, содержит поле-указатель, которое имеет значение `NULL`, если объект не зарегистрирован, или указывает на структуру `struct sigio`, описывающую регистрацию. Это поле защищено глобальным мьютексом `sigio_lock`. Вызывающие функции обслуживания SIGIO должны передавать это поле «по ссылке», чтобы локальные копии регистра не создавались без защиты блокировкой." ], "id_hash": -6716565404634750467, "content_hash": -6716565404634750467, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:221", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 83, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 118, "source_unit": "https://translate-dev.freebsd.org/api/units/1134326/?format=api", "priority": 100, "id": 1811727, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=22c9f759b21161fd", "url": "https://translate-dev.freebsd.org/api/units/1811727/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.241043Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "One `struct sigio` is allocated for each registered object associated with any process or process group, and contains back-pointers to the object, owner, signal information, a credential, and the general disposition of the registration. Each process or progress group contains a list of registered `struct sigio` structures, `p_sigiolst` for processes, and `pg_sigiolst` for process groups. These lists are protected by the process or process group locks respectively. Most fields in each `struct sigio` are constant for the duration of the registration, with the exception of the `sio_pgsigio` field which links the `struct sigio` into the process or process group list. Developers implementing new kernel objects supporting SIGIO will, in general, want to avoid holding structure locks while invoking SIGIO supporting functions, such as `fsetown` or `funsetown` to avoid defining a lock order between structure locks and the global SIGIO lock. This is generally possible through use of an elevated reference count on the structure, such as reliance on a file descriptor reference to a pipe during a pipe operation." ], "previous_source": "", "target": [ "Один `struct sigio` выделяется для каждого зарегистрированного объекта, связанного с любым процессом или группой процессов, и содержит обратные ссылки на объект, владельца, информацию о сигнале, учётные данные и общее состояние регистрации. Каждый процесс или группа процессов содержит список зарегистрированных структур `struct sigio`: `p_sigiolst` для процессов и `pg_sigiolst` для групп процессов. Эти списки защищены блокировками процесса или группы процессов соответственно. Большинство полей в каждой `struct sigio` остаются постоянными на протяжении регистрации, за исключением поля `sio_pgsigio`, которое связывает `struct sigio` со списком процесса или группы процессов. Разработчикам, реализующим новые объекты ядра с поддержкой SIGIO, как правило, следует избегать удержания блокировок структур при вызове функций поддержки SIGIO, таких как `fsetown` или `funsetown`, чтобы не определять порядок блокировок между блокировками структур и глобальной блокировкой SIGIO. Обычно это возможно за счет использования повышенного счетчика ссылок на структуру, например, путем опоры на ссылку файлового дескриптора на канал во время операции с каналом." ], "id_hash": -8756072258407665436, "content_hash": -8756072258407665436, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:223", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 84, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 169, "source_unit": "https://translate-dev.freebsd.org/api/units/1134328/?format=api", "priority": 100, "id": 1811728, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=067c2eac31f570e4", "url": "https://translate-dev.freebsd.org/api/units/1811728/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.241728Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Sysctl" ], "previous_source": "", "target": [ "Sysctl" ], "id_hash": -793675411341850549, "content_hash": -793675411341850549, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:224", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 85, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134330/?format=api", "priority": 100, "id": 1811729, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=74fc4c6b2001c84b", "url": "https://translate-dev.freebsd.org/api/units/1811729/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.242431Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The `sysctl` MIB service is invoked from both within the kernel and from userland applications using a system call. At least two issues are raised in locking: first, the protection of the structures maintaining the namespace, and second, interactions with kernel variables and functions that are accessed by the sysctl interface. Since sysctl permits the direct export (and modification) of kernel statistics and configuration parameters, the sysctl mechanism must become aware of appropriate locking semantics for those variables. Currently, sysctl makes use of a single global sx lock to serialize use of `sysctl`; however, it is assumed to operate under Giant and other protections are not provided. The remainder of this section speculates on locking and semantic changes to sysctl." ], "previous_source": "", "target": [ "Сервис `sysctl` MIB вызывается как из ядра, так и из пользовательских приложений с использованием системного вызова. По крайней мере, два вопроса возникают в отношении блокировок: во-первых, защита структур, поддерживающих пространство имен, и во-вторых, взаимодействие с переменными и функциями ядра, к которым обращается интерфейс `sysctl`. Поскольку `sysctl` позволяет прямое экспортирование (и изменение) статистики ядра и параметров конфигурации, механизм `sysctl` должен учитывать соответствующие семантики блокировок для этих переменных. В настоящее время `sysctl` использует единую глобальную sx-блокировку для сериализации использования `sysctl`; однако предполагается, что он работает под защитой Giant, и другие защиты не предоставляются. Оставшаяся часть этого раздела рассматривает возможные изменения в блокировках и семантике `sysctl`." ], "id_hash": 3687547539830994858, "content_hash": 3687547539830994858, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:227", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 86, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 120, "source_unit": "https://translate-dev.freebsd.org/api/units/1134332/?format=api", "priority": 100, "id": 1811730, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b32cccf333fdf7aa", "url": "https://translate-dev.freebsd.org/api/units/1811730/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.243044Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Need to change the order of operations for sysctl's that update values from read old, copyin and copyout, write new to copyin, lock, read old and write new, unlock, copyout. Normal sysctl's that just copyout the old value and set a new value that they copyin may still be able to follow the old model. However, it may be cleaner to use the second model for all of the sysctl handlers to avoid lock operations." ], "previous_source": "", "target": [ "Необходимо изменить порядок операций для sysctl, которые обновляют значения из чтения старого, copyin и copyout, записи нового на copyin, блокировку, чтение старого и запись нового, разблокировку, copyout. Обычные sysctl, которые просто копируют старое значение и устанавливают новое, которое они копируют, могут по-прежнему следовать старой модели. Однако, возможно, будет чище использовать вторую модель для всех обработчиков sysctl, чтобы избежать операций блокировки." ], "id_hash": -5889583039409538799, "content_hash": -5889583039409538799, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:229", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 87, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 75, "source_unit": "https://translate-dev.freebsd.org/api/units/1134334/?format=api", "priority": 100, "id": 1811731, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=2e43ff6e14d43911", "url": "https://translate-dev.freebsd.org/api/units/1811731/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.243728Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "To allow for the common case, a sysctl could embed a pointer to a mutex in the SYSCTL_FOO macros and in the struct. This would work for most sysctl's. For values protected by sx locks, spin mutexes, or other locking strategies besides a single sleep mutex, SYSCTL_PROC nodes could be used to get the locking right." ], "previous_source": "", "target": [ "Для упрощения распространённого случая, sysctl может включать указатель на мьютекс в макросах SYSCTL_FOO и в структуре. Это будет работать для большинства sysctl. Для значений, защищённых sx-блокировками, спин-мьютексами или другими стратегиями синхронизации, отличными от одиночного мьютекса сна, можно использовать узлы SYSCTL_PROC для обеспечения корректной блокировки." ], "id_hash": -5708887129939331271, "content_hash": -5708887129939331271, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:231", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 88, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 56, "source_unit": "https://translate-dev.freebsd.org/api/units/1134336/?format=api", "priority": 100, "id": 1811732, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=30c5f566fd2ab739", "url": "https://translate-dev.freebsd.org/api/units/1811732/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.244366Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Taskqueue" ], "previous_source": "", "target": [ "Очередь задач" ], "id_hash": -5665239071920150604, "content_hash": -5665239071920150604, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:232", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 89, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1134338/?format=api", "priority": 100, "id": 1811733, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=316107146e8927b4", "url": "https://translate-dev.freebsd.org/api/units/1811733/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.245003Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The taskqueue's interface has two basic locks associated with it in order to protect the related shared data. The `taskqueue_queues_mutex` is meant to serve as a lock to protect the `taskqueue_queues` TAILQ. The other mutex lock associated with this system is the one in the `struct taskqueue` data structure. The use of the synchronization primitive here is to protect the integrity of the data in the `struct taskqueue`. It should be noted that there are no separate macros to assist the user in locking down his/her own work since these locks are most likely not going to be used outside of [.filename]#kern/subr_taskqueue.c#." ], "previous_source": "", "target": [ "Интерфейс `taskqueue` имеет две основные блокировки, связанные с ним, для защиты соответствующих общих данных. Мьютекс `taskqueue_queues_mutex` предназначен для защиты TAILQ `taskqueue_queues`. Другая блокировка мьютекса, связанная с этой системой, находится в структуре данных `struct taskqueue`. Использование примитива синхронизации здесь необходимо для защиты целостности данных в `struct taskqueue`. Следует отметить, что нет отдельных макросов, помогающих пользователю заблокировать свою собственную работу, поскольку эти блокировки, скорее всего, не будут использоваться за пределами [.filename]#kern/subr_taskqueue.c#." ], "id_hash": -288818740836725902, "content_hash": -288818740836725902, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:235", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 90, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 102, "source_unit": "https://translate-dev.freebsd.org/api/units/1134340/?format=api", "priority": 100, "id": 1811734, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=7bfde8e2abf38b72", "url": "https://translate-dev.freebsd.org/api/units/1811734/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.245570Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Implementation Notes" ], "previous_source": "", "target": [ "Заметки о реализации" ], "id_hash": 6461742839068410307, "content_hash": 6461742839068410307, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:237", "context": "", "note": "type: Title ==", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 91, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1134342/?format=api", "priority": 100, "id": 1811735, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=d9acb8e05898c1c3", "url": "https://translate-dev.freebsd.org/api/units/1811735/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.246194Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Sleep Queues" ], "previous_source": "", "target": [ "Очереди сна" ], "id_hash": 1914682859835263082, "content_hash": 1914682859835263082, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:239", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 92, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1134344/?format=api", "priority": 100, "id": 1811736, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=9a9251eaa602886a", "url": "https://translate-dev.freebsd.org/api/units/1811736/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.246804Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "A sleep queue is a structure that holds the list of threads asleep on a wait channel. Each thread that is not asleep on a wait channel carries a sleep queue structure around with it. When a thread blocks on a wait channel, it donates its sleep queue structure to that wait channel. Sleep queues associated with a wait channel are stored in a hash table." ], "previous_source": "", "target": [ "Очередь сна — это структура, которая содержит список потоков, ожидающих на канале ожидания. Каждый поток, который не находится в состоянии ожидания на канале ожидания, хранит структуру очереди сна при себе. Когда поток блокируется на канале ожидания, он передаёт свою структуру очереди сна этому каналу. Очереди сна, связанные с каналом ожидания, хранятся в хеш-таблице." ], "id_hash": 723000331318945460, "content_hash": 723000331318945460, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:242", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 93, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 66, "source_unit": "https://translate-dev.freebsd.org/api/units/1134346/?format=api", "priority": 100, "id": 1811737, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=8a089cf880c166b4", "url": "https://translate-dev.freebsd.org/api/units/1811737/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.247356Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The sleep queue hash table holds sleep queues for wait channels that have at least one blocked thread. Each entry in the hash table is called a sleepqueue chain. The chain contains a linked list of sleep queues and a spin mutex. The spin mutex protects the list of sleep queues as well as the contents of the sleep queue structures on the list. Only one sleep queue is associated with a given wait channel. If multiple threads block on a wait channel than the sleep queues associated with all but the first thread are stored on a list of free sleep queues in the master sleep queue. When a thread is removed from the sleep queue it is given one of the sleep queue structures from the master queue's free list if it is not the only thread asleep on the queue. The last thread is given the master sleep queue when it is resumed. Since threads may be removed from the sleep queue in a different order than they are added, a thread may depart from a sleep queue with a different sleep queue structure than the one it arrived with." ], "previous_source": "", "target": [ "Хеш-таблица очередей сна содержит очереди сна для каналов ожидания, у которых есть хотя бы один заблокированный поток. Каждая запись в хеш-таблице называется цепочкой очереди сна. Цепочка содержит связанный список очередей сна и спин-мьютекс. Спин-мьютекс защищает список очередей сна, а также содержимое структур очередей сна в списке. С каждым каналом ожидания связана только одна очередь сна. Если несколько потоков блокируются на одном канале ожидания, то очереди сна, связанные со всеми потоками, кроме первого, хранятся в списке свободных очередей сна в главной очереди сна. Когда поток удаляется из очереди сна, он получает одну из структур очереди сна из свободного списка главной очереди, если он не является единственным потоком в очереди. Последний поток получает главную очередь сна при возобновлении. Поскольку потоки могут удаляться из очереди сна в порядке, отличном от порядка добавления, поток может покинуть очередь сна с другой структурой очереди сна, чем та, с которой он в неё попал." ], "id_hash": -7203226032141795210, "content_hash": -7203226032141795210, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:244", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 94, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 193, "source_unit": "https://translate-dev.freebsd.org/api/units/1134348/?format=api", "priority": 100, "id": 1811738, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=1c0900168d578076", "url": "https://translate-dev.freebsd.org/api/units/1811738/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.247961Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "The `sleepq_lock` function locks the spin mutex of the sleep queue chain that maps to a specific wait channel. The `sleepq_lookup` function looks in the hash table for the master sleep queue associated with a given wait channel. If no master sleep queue is found, it returns `NULL`. The `sleepq_release` function unlocks the spin mutex associated with a given wait channel." ], "previous_source": "", "target": [ "Функция `sleepq_lock` блокирует спин-мьютекс цепи очереди сна, соответствующей определённому каналу ожидания. Функция `sleepq_lookup` выполняет поиск в хеш-таблице главной очереди сна, связанной с заданным каналом ожидания. Если главная очередь сна не найдена, функция возвращает `NULL`. Функция `sleepq_release` разблокирует спин-мьютекс, связанный с заданным каналом ожидания." ], "id_hash": -1247369725148068346, "content_hash": -1247369725148068346, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:246", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 95, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 61, "source_unit": "https://translate-dev.freebsd.org/api/units/1134350/?format=api", "priority": 100, "id": 1811739, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=6eb073d804f90606", "url": "https://translate-dev.freebsd.org/api/units/1811739/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.248682Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "A thread is added to a sleep queue via the `sleepq_add`. This function accepts the wait channel, a pointer to the mutex that protects the wait channel, a wait message description string, and a mask of flags. The sleep queue chain should be locked via `sleepq_lock` before this function is called. If no mutex protects the wait channel (or it is protected by Giant), then the mutex pointer argument should be `NULL`. The flags argument contains a type field that indicates the kind of sleep queue that the thread is being added to and a flag to indicate if the sleep is interruptible (`SLEEPQ_INTERRUPTIBLE`). Currently there are only two types of sleep queues: traditional sleep queues managed via the `msleep` and `wakeup` functions (`SLEEPQ_MSLEEP`) and condition variable sleep queues (`SLEEPQ_CONDVAR`). The sleep queue type and lock pointer argument are used solely for internal assertion checking. Code that calls `sleepq_add` should explicitly unlock any interlock protecting the wait channel after the associated sleepqueue chain has been locked via `sleepq_lock` and before blocking on the sleep queue via one of the waiting functions." ], "previous_source": "", "target": [ "Поток добавляется в очередь ожидания с помощью `sleepq_add`. Эта функция принимает канал ожидания, указатель на мьютекс, защищающий канал ожидания, строку описания сообщения ожидания и маску флагов. Цепь очереди ожидания должна быть заблокирована с помощью `sleepq_lock` перед вызовом этой функции. Если канал ожидания не защищен мьютексом (или защищен мьютексом Giant), то аргумент указателя на мьютекс должен быть `NULL`. Аргумент флагов содержит поле типа, указывающее на вид очереди ожидания, в которую добавляется поток, и флаг, указывающий, является ли ожидание прерываемым (`SLEEPQ_INTERRUPTIBLE`). В настоящее время существует только два типа очередей ожидания: традиционные очереди, управляемые через функции `msleep` и `wakeup` (`SLEEPQ_MSLEEP`), и очереди ожидания условных переменных (`SLEEPQ_CONDVAR`). Тип очереди ожидания и аргумент указателя на блокировку используются исключительно для внутренних проверок утверждений. Код, вызывающий `sleepq_add`, должен явно разблокировать любой блокировочный механизм, защищающий канал ожидания, после того как связанная цепь очереди ожидания будет заблокирована через `sleepq_lock` и перед блокировкой в очереди ожидания с помощью одной из функций ожидания." ], "id_hash": 997180401207099283, "content_hash": 997180401207099283, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:248", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 96, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 181, "source_unit": "https://translate-dev.freebsd.org/api/units/1134352/?format=api", "priority": 100, "id": 1811740, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=8dd6b24aa6ee3f93", "url": "https://translate-dev.freebsd.org/api/units/1811740/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.249302Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "A timeout for a sleep is set by invoking `sleepq_set_timeout`. The function accepts the wait channel and the timeout time as a relative tick count as its arguments. If a sleep should be interrupted by arriving signals, the `sleepq_catch_signals` function should be called as well. This function accepts the wait channel as its only parameter. If there is already a signal pending for this thread, then `sleepq_catch_signals` will return a signal number; otherwise, it will return 0." ], "previous_source": "", "target": [ "Таймаут для сна устанавливается вызовом `sleepq_set_timeout`. Функция принимает канал ожидания и время таймаута в виде относительного количества тиков в качестве аргументов. Если сон должен быть прерван поступающими сигналами, следует также вызвать функцию `sleepq_catch_signals`. Эта функция принимает канал ожидания в качестве единственного параметра. Если для данного потока уже есть ожидающий сигнал, то `sleepq_catch_signals` вернёт номер сигнала; в противном случае она вернёт 0." ], "id_hash": -7866830466678696394, "content_hash": -7866830466678696394, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:250", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 97, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 77, "source_unit": "https://translate-dev.freebsd.org/api/units/1134354/?format=api", "priority": 100, "id": 1811741, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=12d3675eed655636", "url": "https://translate-dev.freebsd.org/api/units/1811741/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.249998Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Once a thread has been added to a sleep queue, it blocks using one of the `sleepq_wait` functions. There are four wait functions depending on whether or not the caller wishes to use a timeout or have the sleep aborted by caught signals or an interrupt from the userland thread scheduler. The `sleepq_wait` function simply waits until the current thread is explicitly resumed by one of the wakeup functions. The `sleepq_timedwait` function waits until either the thread is explicitly resumed or the timeout set by an earlier call to `sleepq_set_timeout` expires. The `sleepq_wait_sig` function waits until either the thread is explicitly resumed or its sleep is aborted. The `sleepq_timedwait_sig` function waits until either the thread is explicitly resumed, the timeout set by an earlier call to `sleepq_set_timeout` expires, or the thread's sleep is aborted. All of the wait functions accept the wait channel as their first parameter. In addition, the `sleepq_timedwait_sig` function accepts a second boolean parameter to indicate if the earlier call to `sleepq_catch_signals` found a pending signal." ], "previous_source": "", "target": [ "После добавления потока в очередь ожидания он блокируется с использованием одной из функций `sleepq_wait`. Существует четыре функции ожидания в зависимости от того, хочет ли вызывающий код использовать таймаут, прерывание сна перехваченными сигналами или прерывание от планировщика потоков пользовательского пространства. Функция `sleepq_wait` просто ожидает, пока текущий поток не будет явно возобновлён одной из функций пробуждения. Функция `sleepq_timedwait` ожидает, пока поток не будет явно возобновлён или пока не истечёт таймаут, установленный предыдущим вызовом `sleepq_set_timeout`. Функция `sleepq_wait_sig` ожидает, пока поток не будет явно возобновлён или его сон не будет прерван. Функция `sleepq_timedwait_sig` ожидает, пока поток не будет явно возобновлён, не истечёт таймаут, установленный предыдущим вызовом `sleepq_set_timeout`, или сон потока не будет прерван. Все функции ожидания принимают канал ожидания в качестве первого параметра. Кроме того, функция `sleepq_timedwait_sig` принимает второй логический параметр, указывающий, обнаружил ли предыдущий вызов `sleepq_catch_signals` ожидающий сигнал." ], "id_hash": -7874123666220394195, "content_hash": -7874123666220394195, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:252", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 98, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 169, "source_unit": "https://translate-dev.freebsd.org/api/units/1134356/?format=api", "priority": 100, "id": 1811742, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=12b97e3e956fd92d", "url": "https://translate-dev.freebsd.org/api/units/1811742/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.250652Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "If the thread is explicitly resumed or is aborted by a signal, then a value of zero is returned by the wait function to indicate a successful sleep. If the thread is resumed by either a timeout or an interrupt from the userland thread scheduler then an appropriate errno value is returned instead. Note that since `sleepq_wait` can only return 0 it does not return anything and the caller should assume a successful sleep. Also, if a thread's sleep times out and is aborted simultaneously then `sleepq_timedwait_sig` will return an error indicating that a timeout occurred. If an error value of 0 is returned and either `sleepq_wait_sig` or `sleepq_timedwait_sig` was used to block, then the function `sleepq_calc_signal_retval` should be called to check for any pending signals and calculate an appropriate return value if any are found. The signal number returned by the earlier call to `sleepq_catch_signals` should be passed as the sole argument to `sleepq_calc_signal_retval`." ], "previous_source": "", "target": [ "Если поток явно возобновлен или прерван сигналом, функция ожидания возвращает ноль, указывая на успешное завершение сна. Если поток возобновлен по таймауту или прерыванию от планировщика потоков в пользовательском пространстве, вместо этого возвращается соответствующее значение errno. Обратите внимание, что поскольку `sleepq_wait` может возвращать только 0, она ничего не возвращает, и вызывающая сторона должна считать сон успешным. Также, если сон потока прерывается одновременно по таймауту и другим причинам, `sleepq_timedwait_sig` вернет ошибку, указывающую на срабатывание таймаута. Если возвращено значение ошибки 0 и для блокировки использовались `sleepq_wait_sig` или `sleepq_timedwait_sig`, следует вызвать функцию `sleepq_calc_signal_retval` для проверки ожидающих сигналов и вычисления соответствующего возвращаемого значения, если таковые обнаружены. Номер сигнала, полученный при предыдущем вызове `sleepq_catch_signals`, должен быть передан в качестве единственного аргумента в `sleepq_calc_signal_retval`." ], "id_hash": 1130637735844263062, "content_hash": 1130637735844263062, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:254", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 99, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 155, "source_unit": "https://translate-dev.freebsd.org/api/units/1134358/?format=api", "priority": 100, "id": 1811743, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=8fb0d507c6a63496", "url": "https://translate-dev.freebsd.org/api/units/1811743/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.251375Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api", "source": [ "Threads asleep on a wait channel are explicitly resumed by the `sleepq_broadcast` and `sleepq_signal` functions. Both functions accept the wait channel from which to resume threads, a priority to raise resumed threads to, and a flags argument to indicate which type of sleep queue is being resumed. The priority argument is treated as a minimum priority. If a thread being resumed already has a higher priority (numerically lower) than the priority argument then its priority is not adjusted. The flags argument is used for internal assertions to ensure that sleep queues are not being treated as the wrong type. For example, the condition variable functions should not resume threads on a traditional sleep queue. The `sleepq_broadcast` function resumes all threads that are blocked on the specified wait channel while `sleepq_signal` only resumes the highest priority thread blocked on the wait channel. The sleep queue chain should first be locked via the `sleepq_lock` function before calling these functions." ], "previous_source": "", "target": [ "Потоки, находящиеся в состоянии ожидания на канале ожидания, явно возобновляются функциями `sleepq_broadcast` и `sleepq_signal`. Обе функции принимают канал ожидания, с которого нужно возобновить потоки, приоритет, на который нужно поднять возобновлённые потоки, и аргумент флагов, указывающий тип очереди ожидания, которую нужно возобновить. Аргумент приоритета трактуется как минимальный приоритет. Если у возобновляемого потока уже есть более высокий приоритет (численно меньший), чем указанный в аргументе, его приоритет не изменяется. Аргумент флагов используется для внутренних проверок, чтобы гарантировать, что очереди ожидания не обрабатываются как неправильный тип. Например, функции условных переменных не должны возобновлять потоки на традиционной очереди ожидания. Функция `sleepq_broadcast` возобновляет все потоки, заблокированные на указанном канале ожидания, тогда как `sleepq_signal` возобновляет только поток с наивысшим приоритетом, заблокированный на канале ожидания. Перед вызовом этих функций цепочка очереди ожидания должна быть заблокирована с помощью функции `sleepq_lock`." ], "id_hash": -6390541369801379156, "content_hash": -6390541369801379156, "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:256", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 100, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 157, "source_unit": "https://translate-dev.freebsd.org/api/units/1134360/?format=api", "priority": 100, "id": 1811744, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=27503c7b928cf2ac", "url": "https://translate-dev.freebsd.org/api/units/1811744/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2025-05-25T08:25:10.252071Z" } ] }