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
HTTP 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 156,
    "next": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/units/?format=api&page=2",
    "previous": null,
    "results": [
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "SMPng Design Document"
            ],
            "previous_source": "",
            "target": [
                "Документ по архитектуре SMPng"
            ],
            "id_hash": 3396486269137973460,
            "content_hash": 3396486269137973460,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:1, documentation/content/en/books/arch-handbook/smp/_index.adoc:14",
            "context": "",
            "note": "type: Title =",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 1,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 3,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134164/?format=api",
            "priority": 100,
            "id": 1811645,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=af22be443475f0d4",
            "url": "https://translate-dev.freebsd.org/api/units/1811645/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.190425Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Chapter 8. SMPng Design Document"
            ],
            "previous_source": "",
            "target": [
                "Глава 8. Документ по архитектуре SMPng"
            ],
            "id_hash": -3646889918242395121,
            "content_hash": -3646889918242395121,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:1",
            "context": "",
            "note": "type: YAML Front Matter: title",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 2,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134162/?format=api",
            "priority": 100,
            "id": 1811646,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=4d63a4f100356c0f",
            "url": "https://translate-dev.freebsd.org/api/units/1811646/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.191166Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Introduction"
            ],
            "previous_source": "",
            "target": [
                "Введение"
            ],
            "id_hash": 5330140601372690748,
            "content_hash": 5330140601372690748,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:52",
            "context": "",
            "note": "type: Title ==",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 3,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134166/?format=api",
            "priority": 100,
            "id": 1811647,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=c9f876a2fbb4c93c",
            "url": "https://translate-dev.freebsd.org/api/units/1811647/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.191804Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "This document presents the current design and implementation of the SMPng Architecture. First, the basic primitives and tools are introduced. Next, a general architecture for the FreeBSD kernel's synchronization and execution model is laid out. Then, locking strategies for specific subsystems are discussed, documenting the approaches taken to introduce fine-grained synchronization and parallelism for each subsystem. Finally, detailed implementation notes are provided to motivate design choices, and make the reader aware of important implications involving the use of specific primitives."
            ],
            "previous_source": "",
            "target": [
                "В этом документе представлены текущая архитектура и реализация SMPng. Сначала вводятся основные примитивы и инструменты. Затем излагается общая архитектура модели синхронизации и выполнения ядра FreeBSD. Далее обсуждаются стратегии блокировок для конкретных подсистем, описывающие подходы к внедрению детализированной синхронизации и параллелизма для каждой подсистемы. В заключение приводятся подробные заметки по реализации, объясняющие выбор проектных решений и информирующие читателя о важных последствиях использования конкретных примитивов."
            ],
            "id_hash": 3941456065252402286,
            "content_hash": 3941456065252402286,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:55",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 4,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 80,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134168/?format=api",
            "priority": 100,
            "id": 1811648,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b6b2dd689b2da46e",
            "url": "https://translate-dev.freebsd.org/api/units/1811648/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.192388Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "This document is a work-in-progress, and will be updated to reflect on-going design and implementation activities associated with the SMPng Project. Many sections currently exist only in outline form, but will be fleshed out as work proceeds. Updates or suggestions regarding the document may be directed to the document editors."
            ],
            "previous_source": "",
            "target": [
                "Этот документ находится в стадии разработки и будет обновляться в соответствии с текущими проектированием и реализацией, связанными с проектом SMPng. Многие разделы в настоящее время существуют только в виде набросков, но будут дополняться по мере продвижения работы. Обновления или предложения по документу могут быть направлены редакторам документа."
            ],
            "id_hash": -4544286146076902557,
            "content_hash": -4544286146076902557,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:57",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 5,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 50,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134170/?format=api",
            "priority": 100,
            "id": 1811649,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=40ef73d3a95b7b63",
            "url": "https://translate-dev.freebsd.org/api/units/1811649/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.193042Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The goal of SMPng is to allow concurrency in the kernel. The kernel is basically one rather large and complex program. To make the kernel multi-threaded we use some of the same tools used to make other programs multi-threaded. These include mutexes, shared/exclusive locks, semaphores, and condition variables. For the definitions of these and other SMP-related terms, please see the crossref:smp[smp-glossary, Glossary] section of this article."
            ],
            "previous_source": "",
            "target": [
                "Цель SMPng — обеспечить параллелизм в ядре. Ядро представляет собой одну довольно большую и сложную программу. Чтобы сделать ядро многопоточным, мы используем те же инструменты, что и для многопоточности других программ. К ним относятся мьютексы, разделяемые/монопольные блокировки, семафоры и условные переменные. Для определений этих и других терминов, связанных с SMP, см. раздел crossref:smp[smp-glossary, Глоссарий] в этой статье."
            ],
            "id_hash": -6516304786414838398,
            "content_hash": -6516304786414838398,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:63",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 6,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 66,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1724364/?format=api",
            "priority": 100,
            "id": 1811650,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=25916f525590dd82",
            "url": "https://translate-dev.freebsd.org/api/units/1811650/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.193751Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Basic Tools and Locking Fundamentals"
            ],
            "previous_source": "",
            "target": [
                "Основные инструменты и основы блокировки"
            ],
            "id_hash": -7789654493086596979,
            "content_hash": -7789654493086596979,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:65",
            "context": "",
            "note": "type: Title ==",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 7,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134174/?format=api",
            "priority": 100,
            "id": 1811651,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=13e59682888c408d",
            "url": "https://translate-dev.freebsd.org/api/units/1811651/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.194418Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Atomic Instructions and Memory Barriers"
            ],
            "previous_source": "",
            "target": [
                "Атомарные инструкции и барьеры памяти"
            ],
            "id_hash": 8971777210660439514,
            "content_hash": 8971777210660439514,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:67",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 8,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134176/?format=api",
            "priority": 100,
            "id": 1811652,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=fc8227d6ad5c45da",
            "url": "https://translate-dev.freebsd.org/api/units/1811652/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.195012Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "There are several existing treatments of memory barriers and atomic instructions, so this section will not include a lot of detail. To put it simply, one can not go around reading variables without a lock if a lock is used to protect writes to that variable. This becomes obvious when you consider that memory barriers simply determine relative order of memory operations; they do not make any guarantee about timing of memory operations. That is, a memory barrier does not force the contents of a CPU's local cache or store buffer to flush. Instead, the memory barrier at lock release simply ensures that all writes to the protected data will be visible to other CPU's or devices if the write to release the lock is visible. The CPU is free to keep that data in its cache or store buffer as long as it wants. However, if another CPU performs an atomic instruction on the same datum, the first CPU must guarantee that the updated value is made visible to the second CPU along with any other operations that memory barriers may require."
            ],
            "previous_source": "",
            "target": [
                "Можно найти много описаний барьеров памяти и атомарных инструкций, поэтому в этом разделе не будет много деталей. Проще говоря, нельзя читать переменные без блокировки, если блокировка используется для защиты записи в эту переменную. Это становится очевидным, если учесть, что барьеры памяти лишь определяют относительный порядок операций с памятью; они не дают никаких гарантий относительно времени выполнения этих операций. То есть, барьер памяти не принуждает к сбросу содержимого локального кэша или буфера записи процессора. Вместо этого, барьер памяти при освобождении блокировки просто гарантирует, что все записи в защищённые данные будут видны другим процессорам или устройствам, если видна запись, освобождающая блокировку. Процессор может хранить эти данные в своём кэше или буфере записи сколько угодно долго. Однако, если другой процессор выполняет атомарную инструкцию над тем же данным, первый процессор должен гарантировать, что обновлённое значение будет видно второму процессору, наряду с любыми другими операциями, которые могут потребоваться согласно барьерам памяти."
            ],
            "id_hash": 4667846920451657231,
            "content_hash": 4667846920451657231,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:70",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 9,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 183,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134178/?format=api",
            "priority": 100,
            "id": 1811653,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=c0c7860af76c0e0f",
            "url": "https://translate-dev.freebsd.org/api/units/1811653/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.195611Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "For example, assuming a simple model where data is considered visible when it is in main memory (or a global cache), when an atomic instruction is triggered on one CPU, other CPU's store buffers and caches must flush any writes to that same cache line along with any pending operations behind a memory barrier."
            ],
            "previous_source": "",
            "target": [
                "Например, предполагая простую модель, в которой данные считаются видимыми, когда они находятся в основной памяти (или в глобальном кэше), когда начинается выполнение атомарной инструкции на одном процессоре, буферы записи и кэши других процессоров должны выполнить все записи в ту же строку кэша вместе с любыми ожидающими операциями за барьером памяти."
            ],
            "id_hash": 3642835636987959963,
            "content_hash": 3642835636987959963,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:72",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 10,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 54,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134180/?format=api",
            "priority": 100,
            "id": 1811654,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b28df3b615cd1a9b",
            "url": "https://translate-dev.freebsd.org/api/units/1811654/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.196337Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "This requires one to take special care when using an item protected by atomic instructions. For example, in the sleep mutex implementation, we have to use an `atomic_cmpset` rather than an `atomic_set` to turn on the `MTX_CONTESTED` bit. The reason is that we read the value of `mtx_lock` into a variable and then make a decision based on that read. However, the value we read may be stale, or it may change while we are making our decision. Thus, when the `atomic_set` executed, it may end up setting the bit on another value than the one we made the decision on. Thus, we have to use an `atomic_cmpset` to set the value only if the value we made the decision on is up-to-date and valid."
            ],
            "previous_source": "",
            "target": [
                "Это требует особой осторожности при использовании элемента, защищённого атомарными инструкциями. Например, в реализации мьютекса сна мы должны использовать `atomic_cmpset` вместо `atomic_set` для установки бита `MTX_CONTESTED`. Причина в том, что мы считываем значение `mtx_lock` в переменную и затем принимаем решение на основе этого чтения. Однако значение, которое мы ранее прочитали, может быть устаревшим или измениться, пока мы принимаем решение. Таким образом, когда выполняется `atomic_set`, это может привести к установке бита на другом значении, отличном от того, на котором мы основывали своё решение. Поэтому мы должны использовать `atomic_cmpset`, чтобы установить значение только в том случае, если значение, на котором мы приняли решение, актуально и действительно."
            ],
            "id_hash": 3413074382387017462,
            "content_hash": 3413074382387017462,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:74",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 11,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 125,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134182/?format=api",
            "priority": 100,
            "id": 1811655,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=af5dad114a29f6f6",
            "url": "https://translate-dev.freebsd.org/api/units/1811655/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.196962Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Finally, atomic instructions only allow one item to be updated or read. If one needs to atomically update several items, then a lock must be used instead. For example, if two counters must be read and have values that are consistent relative to each other, then those counters must be protected by a lock rather than by separate atomic instructions."
            ],
            "previous_source": "",
            "target": [
                "Наконец, атомарные инструкции позволяют обновить или прочитать только один элемент. Если необходимо атомарно обновить несколько элементов, вместо этого следует использовать блокировку. Например, если требуется прочитать два счётчика и получить их значения, согласованные друг с другом, то эти счётчики должны быть защищены блокировкой, а не отдельными атомарными инструкциями."
            ],
            "id_hash": -479607699138398771,
            "content_hash": -479607699138398771,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:76",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 12,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 60,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134184/?format=api",
            "priority": 100,
            "id": 1811656,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=79581756b55035cd",
            "url": "https://translate-dev.freebsd.org/api/units/1811656/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.197667Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Read Locks Versus Write Locks"
            ],
            "previous_source": "",
            "target": [
                "Блокировки на чтение и блокировки на запись"
            ],
            "id_hash": 3839873069012099358,
            "content_hash": 3839873069012099358,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:77",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 13,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134186/?format=api",
            "priority": 100,
            "id": 1811657,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b549f836350e211e",
            "url": "https://translate-dev.freebsd.org/api/units/1811657/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.198278Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Read locks do not need to be as strong as write locks. Both types of locks need to ensure that the data they are accessing is not stale. However, only write access requires exclusive access. Multiple threads can safely read a value. Using different types of locks for reads and writes can be implemented in a number of ways."
            ],
            "previous_source": "",
            "target": [
                "Блокировки на чтение не требуют такой же строгости, как блокировки на запись. Оба типа блокировок должны гарантировать, что данные, к которым они обращаются, не устарели. Однако запись требует монопольного доступа. Несколько потоков могут безопасно читать значение. Использование разных типов блокировок для чтения и записи может быть реализовано несколькими способами."
            ],
            "id_hash": 6719598516729517991,
            "content_hash": 6719598516729517991,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:80",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 14,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 59,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134188/?format=api",
            "priority": 100,
            "id": 1811658,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=dd40cf3fbee797a7",
            "url": "https://translate-dev.freebsd.org/api/units/1811658/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.198834Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "First, sx locks can be used in this manner by using an exclusive lock when writing and a shared lock when reading. This method is quite straightforward."
            ],
            "previous_source": "",
            "target": [
                "Во-первых, блокировки sx могут использоваться таким образом: монопольная блокировка при записи и разделяемая блокировка при чтении. Этот метод достаточно прост."
            ],
            "id_hash": -3152211437227272785,
            "content_hash": -3152211437227272785,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:82",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 15,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 27,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134190/?format=api",
            "priority": 100,
            "id": 1811659,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=54411866232515af",
            "url": "https://translate-dev.freebsd.org/api/units/1811659/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.199456Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "A second method is a bit more obscure. You can protect a datum with multiple locks. Then for reading that data you simply need to have a read lock of one of the locks. However, to write to the data, you need to have a write lock of all of the locks. This can make writing rather expensive but can be useful when data is accessed in various ways. For example, the parent process pointer is protected by both the `proctree_lock` sx lock and the per-process mutex. Sometimes the proc lock is easier as we are just checking to see who a parent of a process is that we already have locked. However, other places such as `inferior` need to walk the tree of processes via parent pointers and locking each process would be prohibitive as well as a pain to guarantee that the condition you are checking remains valid for both the check and the actions taken as a result of the check."
            ],
            "previous_source": "",
            "target": [
                "Второй метод несколько менее очевиден. Вы можете защитить данные несколькими блокировками. Для чтения данных достаточно получить блокировку на чтение одной из блокировок. Однако для записи данных необходимо получить блокировку на запись всех блокировок. Это может сделать запись довольно затратной, но может быть полезно, когда данные доступны различными способами. Например, указатель на родительский процесс защищён как `proctree_lock` sx-блокировкой, так и мьютексом процесса. Иногда блокировка процесса удобнее, так как мы просто проверяем, кто является родителем уже заблокированного процесса. Однако в других случаях, таких как `inferior`, необходимо обходить дерево процессов через указатели на родителя, и блокировка каждого процесса была бы слишком затратной, а также сложной для гарантии того, что проверяемое условие остаётся верным как во время проверки, так и при выполнении действий, основанных на этой проверке."
            ],
            "id_hash": 8511388188322747696,
            "content_hash": 8511388188322747696,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:84",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 16,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 164,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134192/?format=api",
            "priority": 100,
            "id": 1811660,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=f61e8676466ed530",
            "url": "https://translate-dev.freebsd.org/api/units/1811660/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.200065Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Locking Conditions and Results"
            ],
            "previous_source": "",
            "target": [
                "Условия и результаты блокировки"
            ],
            "id_hash": -5636995876211773366,
            "content_hash": -5636995876211773366,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:85",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 17,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 4,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134194/?format=api",
            "priority": 100,
            "id": 1811661,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=31c55e1dde0e304a",
            "url": "https://translate-dev.freebsd.org/api/units/1811661/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.200743Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "If you need a lock to check the state of a variable so that you can take an action based on the state you read, you can not just hold the lock while reading the variable and then drop the lock before you act on the value you read. Once you drop the lock, the variable can change rendering your decision invalid. Thus, you must hold the lock both while reading the variable and while performing the action as a result of the test."
            ],
            "previous_source": "",
            "target": [
                "Если вам нужна блокировка для проверки состояния переменной, чтобы можно было выполнить действие на основе прочитанного состояния, вы не можете просто удерживать блокировку во время чтения переменной, а затем снять блокировку перед выполнением действия на основе прочитанного значения. Как только вы снимаете блокировку, переменная может измениться, что сделает ваше решение недействительным. Таким образом, вы должны удерживать блокировку как во время чтения переменной, так и во время выполнения действия в результате проверки."
            ],
            "id_hash": 4129941161766870785,
            "content_hash": 4129941161766870785,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:88",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 18,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 84,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134196/?format=api",
            "priority": 100,
            "id": 1811662,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b9507f9af260df01",
            "url": "https://translate-dev.freebsd.org/api/units/1811662/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.201399Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "General Architecture and Design"
            ],
            "previous_source": "",
            "target": [
                "Общая Архитектура и Дизайн"
            ],
            "id_hash": 5933115187828741656,
            "content_hash": 5933115187828741656,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:90",
            "context": "",
            "note": "type: Title ==",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 19,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 4,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134198/?format=api",
            "priority": 100,
            "id": 1811663,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=d256a8d40e01d618",
            "url": "https://translate-dev.freebsd.org/api/units/1811663/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.202057Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Interrupt Handling"
            ],
            "previous_source": "",
            "target": [
                "Обработка прерываний"
            ],
            "id_hash": -7610166259328719743,
            "content_hash": -7610166259328719743,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:92",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 20,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 2,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134200/?format=api",
            "priority": 100,
            "id": 1811664,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=1663421b870c6481",
            "url": "https://translate-dev.freebsd.org/api/units/1811664/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.202635Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Following the pattern of several other multi-threaded UNIX(R) kernels, FreeBSD deals with interrupt handlers by giving them their own thread context. Providing a context for interrupt handlers allows them to block on locks. To help avoid latency, however, interrupt threads run at real-time kernel priority. Thus, interrupt handlers should not execute for very long to avoid starving other kernel threads. In addition, since multiple handlers may share an interrupt thread, interrupt handlers should not sleep or use a sleepable lock to avoid starving another interrupt handler."
            ],
            "previous_source": "",
            "target": [
                "Следуя примеру нескольких других многопоточных ядер UNIX(R), FreeBSD реализовала обработчики прерываний, предоставив им собственный контекст потока. Предоставление контекста для обработчиков прерываний позволяет им блокироваться на блокировках. Однако, чтобы избежать задержек, потоки обработки прерываний выполняются с приоритетом реального времени в ядре. Таким образом, обработчики прерываний не должны выполняться слишком долго, чтобы не лишать ресурсов другие потоки ядра. Кроме того, поскольку несколько обработчиков могут использовать один поток прерываний, обработчики прерываний не должны переходить в режим сна или использовать блокировки, допускающие сон, чтобы не лишать ресурсов другие обработчики прерываний."
            ],
            "id_hash": 2742999203787513451,
            "content_hash": 2742999203787513451,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:95",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 21,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 86,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134202/?format=api",
            "priority": 100,
            "id": 1811665,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=a611173e28ef1e6b",
            "url": "https://translate-dev.freebsd.org/api/units/1811665/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.203215Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The interrupt threads currently in FreeBSD are referred to as heavyweight interrupt threads. They are called this because switching to an interrupt thread involves a full context switch. In the initial implementation, the kernel was not preemptive and thus interrupts that interrupted a kernel thread would have to wait until the kernel thread blocked or returned to userland before they would have an opportunity to run."
            ],
            "previous_source": "",
            "target": [
                "Текущие потоки обработки прерываний в FreeBSD называются тяжеловесными потоками обработки прерываний. Они получили такое название, потому что переключение на поток обработки прерывания включает в себя полное переключение контекста. В первоначальной реализации ядро не было вытесняющим, поэтому прерывания, которые прерывали поток ядра, должны были ждать, пока поток ядра не заблокируется или не вернётся в пользовательское пространство, прежде чем у них появится возможность выполниться."
            ],
            "id_hash": 8345770039116664396,
            "content_hash": 8345770039116664396,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:97",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 22,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 66,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134204/?format=api",
            "priority": 100,
            "id": 1811666,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=f3d221a1fea58e4c",
            "url": "https://translate-dev.freebsd.org/api/units/1811666/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.203872Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "To deal with the latency problems, the kernel in FreeBSD has been made preemptive. Currently, we only preempt a kernel thread when we release a sleep mutex or when an interrupt comes in. However, the plan is to make the FreeBSD kernel fully preemptive as described below."
            ],
            "previous_source": "",
            "target": [
                "Для решения проблем с задержками ядро FreeBSD стало вытесняющим. В настоящее время вытеснение потока ядра происходит только при освобождении мьютекса сна или при поступлении прерывания. Однако планируется сделать ядро FreeBSD полностью вытесняющим, как описано ниже."
            ],
            "id_hash": -7624886595071531961,
            "content_hash": -7624886595071531961,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:99",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 23,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 47,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134206/?format=api",
            "priority": 100,
            "id": 1811667,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=162ef60a481fa447",
            "url": "https://translate-dev.freebsd.org/api/units/1811667/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.204563Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Not all interrupt handlers execute in a thread context. Instead, some handlers execute directly in primary interrupt context. These interrupt handlers are currently misnamed \"fast\" interrupt handlers since the `INTR_FAST` flag used in earlier versions of the kernel is used to mark these handlers. The only interrupts which currently use these types of interrupt handlers are clock interrupts and serial I/O device interrupts. Since these handlers do not have their own context, they may not acquire blocking locks and thus may only use spin mutexes."
            ],
            "previous_source": "",
            "target": [
                "Не все обработчики прерываний выполняются в контексте потока. Вместо этого, некоторые обработчики выполняются непосредственно в основном контексте прерывания. Эти обработчики прерываний в настоящее время ошибочно называются \"быстрыми\" обработчиками прерываний, поскольку для их обозначения применяется флаг `INTR_FAST`, использовавшийся в более ранних версиях ядра. Единственные прерывания, которые в настоящее время используют такие обработчики прерываний, — это прерывания от часов и последовательных устройств ввода-вывода. Поскольку эти обработчики не имеют собственного контекста, они не могут захватывать блокирующие блокировки и, следовательно, могут использовать только спин-мьютексы."
            ],
            "id_hash": 6868866715462382615,
            "content_hash": 6868866715462382615,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:101",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 24,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 85,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134208/?format=api",
            "priority": 100,
            "id": 1811668,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=df531de288a3b417",
            "url": "https://translate-dev.freebsd.org/api/units/1811668/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.205202Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Finally, there is one optional optimization that can be added in MD code called lightweight context switches. Since an interrupt thread executes in a kernel context, it can borrow the vmspace of any process. Thus, in a lightweight context switch, the switch to the interrupt thread does not switch vmspaces but borrows the vmspace of the interrupted thread. In order to ensure that the vmspace of the interrupted thread does not disappear out from under us, the interrupted thread is not allowed to execute until the interrupt thread is no longer borrowing its vmspace. This can happen when the interrupt thread either blocks or finishes. If an interrupt thread blocks, then it will use its own context when it is made runnable again. Thus, it can release the interrupted thread."
            ],
            "previous_source": "",
            "target": [
                "Наконец, существует одна дополнительная оптимизация, которую можно добавить в код MD, называемая легковесными переключениями контекста. Поскольку поток обработки прерывания выполняется в контексте ядра, он может заимствовать vmspace любого процесса. Таким образом, при легковесном переключении контекста переход к потоку обработки прерывания не меняет vmspace, а заимствует vmspace прерванного потока. Чтобы гарантировать, что vmspace прерванного потока не исчезнет во время работы, прерванному потоку запрещается выполнение до тех пор, пока поток обработки прерывания больше не использует его vmspace. Это может произойти, когда поток обработки прерывания либо блокируется, либо завершается. Если поток обработки прерывания блокируется, то при повторном запуске он будет использовать свой собственный контекст. Таким образом, он может освободить прерванный поток."
            ],
            "id_hash": 5504032643905305855,
            "content_hash": 5504032643905305855,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:103",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 25,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 130,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134210/?format=api",
            "priority": 100,
            "id": 1811669,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=cc6240872c213cff",
            "url": "https://translate-dev.freebsd.org/api/units/1811669/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.205842Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The cons of this optimization are that they are very machine specific and complex and thus only worth the effort if their is a large performance improvement. At this point it is probably too early to tell, and in fact, will probably hurt performance as almost all interrupt handlers will immediately block on Giant and require a thread fix-up when they block. Also, an alternative method of interrupt handling has been proposed by Mike Smith that works like so:"
            ],
            "previous_source": "",
            "target": [
                "Недостатки этой оптимизации заключаются в том, что они очень специфичны для конкретной машины и сложны, поэтому стоят усилий только в случае значительного улучшения производительности. На данный момент, вероятно, ещё рано делать выводы, и, фактически, это может даже ухудшить производительность, так как почти все обработчики прерываний будут немедленно блокироваться на Giant и потребуют исправления потока при блокировке. Кроме того, Майк Смит предложил альтернативный метод обработки прерываний, который работает следующим образом:"
            ],
            "id_hash": -303862744160159044,
            "content_hash": -303862744160159044,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:105",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 26,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 79,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134212/?format=api",
            "priority": 100,
            "id": 1811670,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=7bc87671b1dbbabc",
            "url": "https://translate-dev.freebsd.org/api/units/1811670/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.206530Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Each interrupt handler has two parts: a predicate which runs in primary interrupt context and a handler which runs in its own thread context."
            ],
            "previous_source": "",
            "target": [
                "Каждый обработчик прерывания состоит из двух частей: предиката, который выполняется в основном контексте прерывания, и обработчика, который выполняется в контексте собственного потока."
            ],
            "id_hash": 7726467565623948429,
            "content_hash": 7726467565623948429,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:107",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 27,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 24,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134214/?format=api",
            "priority": 100,
            "id": 1811671,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=eb39ed507997b48d",
            "url": "https://translate-dev.freebsd.org/api/units/1811671/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.207173Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "If an interrupt handler has a predicate, then when an interrupt is triggered, the predicate is run. If the predicate returns true then the interrupt is assumed to be fully handled and the kernel returns from the interrupt. If the predicate returns false or there is no predicate, then the threaded handler is scheduled to run."
            ],
            "previous_source": "",
            "target": [
                "Если у обработчика прерывания есть предикат, то при срабатывании прерывания этот предикат выполняется. Если предикат возвращает значение `true`, прерывание считается полностью обработанным, и ядро возвращается из прерывания. Если предикат возвращает `false` или предиката нет, то система планирует запуск обработчика в контексте собственного потока."
            ],
            "id_hash": -4915243112679639315,
            "content_hash": -4915243112679639315,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:108",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 28,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 56,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134216/?format=api",
            "priority": 100,
            "id": 1811672,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=3bc98c6e5c0b76ed",
            "url": "https://translate-dev.freebsd.org/api/units/1811672/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.207745Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Fitting light weight context switches into this scheme might prove rather complicated. Since we may want to change to this scheme at some point in the future, it is probably best to defer work on light weight context switches until we have settled on the final interrupt handling architecture and determined how light weight context switches might or might not fit into it."
            ],
            "previous_source": "",
            "target": [
                "Встраивание легковесных переключений контекста в эту схему может оказаться довольно сложным. Поскольку мы, возможно, захотим перейти на эту схему в будущем, вероятно, лучше отложить работу над легковесными переключениями контекста до тех пор, пока мы не определимся с окончательной архитектурой обработки прерываний и не выясним, как легковесные переключения контекста могут (или не могут) в неё вписаться."
            ],
            "id_hash": 1748165472498090935,
            "content_hash": 1748165472498090935,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:110",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 29,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 63,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134218/?format=api",
            "priority": 100,
            "id": 1811673,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=9842bb3c2cda03b7",
            "url": "https://translate-dev.freebsd.org/api/units/1811673/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.208345Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Kernel Preemption and Critical Sections"
            ],
            "previous_source": "",
            "target": [
                "Ядро с вытеснением и критические секции"
            ],
            "id_hash": -1736427204040049588,
            "content_hash": -1736427204040049588,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:111",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 30,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134220/?format=api",
            "priority": 100,
            "id": 1811674,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=67e6f8a86cde3c4c",
            "url": "https://translate-dev.freebsd.org/api/units/1811674/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.208967Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Kernel Preemption in a Nutshell"
            ],
            "previous_source": "",
            "target": [
                "Ядро и вытеснение вкратце"
            ],
            "id_hash": -7262069130727941492,
            "content_hash": -7262069130727941492,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:113",
            "context": "",
            "note": "type: Title ====",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 31,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 5,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134222/?format=api",
            "priority": 100,
            "id": 1811675,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=1b37f29a08a19a8c",
            "url": "https://translate-dev.freebsd.org/api/units/1811675/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.209522Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Kernel preemption is fairly simple. The basic idea is that a CPU should always be doing the highest priority work available. Well, that is the ideal at least. There are a couple of cases where the expense of achieving the ideal is not worth being perfect."
            ],
            "previous_source": "",
            "target": [
                "Вытеснение ядра довольно просто. Основная идея заключается в том, что процессор всегда должен выполнять наиболее приоритетную доступную работу. Ну, это в идеале, по крайней мере. Есть несколько случаев, когда затраты на достижение идеала не стоят совершенства."
            ],
            "id_hash": -8184681061848025606,
            "content_hash": -8184681061848025606,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:116",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 32,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 46,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134224/?format=api",
            "priority": 100,
            "id": 1811676,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=0e6a2bf044ae75fa",
            "url": "https://translate-dev.freebsd.org/api/units/1811676/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.210064Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Implementing full kernel preemption is very straightforward: when you schedule a thread to be executed by putting it on a run queue, you check to see if its priority is higher than the currently executing thread. If so, you initiate a context switch to that thread."
            ],
            "previous_source": "",
            "target": [
                "Реализация полной вытесняющей многозадачности в ядре очень проста: когда вы планируете выполнение потока, помещая его в очередь выполнения, вы проверяете, является ли его приоритет выше, чем у текущего выполняемого потока. Если да, вы инициируете переключение контекста на этот поток."
            ],
            "id_hash": -3596768486781175441,
            "content_hash": -3596768486781175441,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:118",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 33,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 46,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134226/?format=api",
            "priority": 100,
            "id": 1811677,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=4e15b61e2616b96f",
            "url": "https://translate-dev.freebsd.org/api/units/1811677/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.210676Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "While locks can protect most data in the case of a preemption, not all of the kernel is preemption safe. For example, if a thread holding a spin mutex preempted and the new thread attempts to grab the same spin mutex, the new thread may spin forever as the interrupted thread may never get a chance to execute. Also, some code such as the code to assign an address space number for a process during `exec` on the Alpha needs to not be preempted as it supports the actual context switch code. Preemption is disabled for these code sections by using a critical section."
            ],
            "previous_source": "",
            "target": [
                "Хотя блокировки могут защитить большинство данных в случае вытеснения, не все части ядра безопасны для вытеснения. Например, если поток, удерживающий спин-блокировку, будет вытеснен, а новый поток попытается захватить ту же спин-блокировку, новый поток может вращаться вечно, так как прерванный поток может никогда не получить шанс на выполнение. Кроме того, некоторый код, такой как код для назначения номера адресного пространства процессу во время `exec` на Alpha, не должен быть вытеснен, так как он поддерживает фактический код переключения контекста. Для таких участков кода вытеснение отключается с использованием критической секции."
            ],
            "id_hash": -4476678145260551362,
            "content_hash": -4476678145260551362,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:120",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 34,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 104,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134228/?format=api",
            "priority": 100,
            "id": 1811678,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=41dfa4f201fd833e",
            "url": "https://translate-dev.freebsd.org/api/units/1811678/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.211272Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Critical Sections"
            ],
            "previous_source": "",
            "target": [
                "Критические Секции"
            ],
            "id_hash": 8822674996579536879,
            "content_hash": 8822674996579536879,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:121",
            "context": "",
            "note": "type: Title ====",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 35,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 2,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134230/?format=api",
            "priority": 100,
            "id": 1811679,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=fa70702a33d80fef",
            "url": "https://translate-dev.freebsd.org/api/units/1811679/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.211903Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The responsibility of the critical section API is to prevent context switches inside of a critical section. With a fully preemptive kernel, every `setrunqueue` of a thread other than the current thread is a preemption point. One implementation is for `critical_enter` to set a per-thread flag that is cleared by its counterpart. If `setrunqueue` is called with this flag set, it does not preempt regardless of the priority of the new thread relative to the current thread. However, since critical sections are used in spin mutexes to prevent context switches and multiple spin mutexes can be acquired, the critical section API must support nesting. For this reason the current implementation uses a nesting count instead of a single per-thread flag."
            ],
            "previous_source": "",
            "target": [
                "Ответственность API критической секции заключается в предотвращении переключения контекста внутри критической секции. В полностью вытесняющем ядре каждый вызов `setrunqueue` для потока, отличного от текущего, является точкой вытеснения. Одна из реализаций заключается в том, что `critical_enter` устанавливает флаг для каждого потока, который сбрасывается его парной функцией. Если `setrunqueue` вызывается, когда этот флаг установлен, вытеснение не происходит, независимо от приоритета нового потока относительно текущего. Однако, поскольку критические секции используются в спин-блокировках для предотвращения переключения контекста и может быть захвачено несколько спин-блокировок, API критической секции должен поддерживать вложенность. По этой причине текущая реализация использует счетчик вложенности вместо одиночного флага для каждого потока."
            ],
            "id_hash": 5362449329766157858,
            "content_hash": 5362449329766157858,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:124",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 36,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 120,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134232/?format=api",
            "priority": 100,
            "id": 1811680,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=ca6b3f4102be4e22",
            "url": "https://translate-dev.freebsd.org/api/units/1811680/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.212503Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "In order to minimize latency, preemptions inside of a critical section are deferred rather than dropped. If a thread that would normally be preempted to is made runnable while the current thread is in a critical section, then a per-thread flag is set to indicate that there is a pending preemption. When the outermost critical section is exited, the flag is checked. If the flag is set, then the current thread is preempted to allow the higher priority thread to run."
            ],
            "previous_source": "",
            "target": [
                "Для минимизации задержек прерывания внутри критической секции откладываются, а не отбрасываются. Если поток, который в обычных условиях должен быть вытеснен, становится готовым к выполнению, пока текущий поток находится в критической секции, то устанавливается флаг для данного потока, указывающий на ожидающее прерывание. При выходе из самой внешней критической секции флаг проверяется. Если флаг установлен, текущий поток вытесняется, чтобы позволить выполниться потоку с более высоким приоритетом."
            ],
            "id_hash": 4614886110510490439,
            "content_hash": 4614886110510490439,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:126",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 37,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 81,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134234/?format=api",
            "priority": 100,
            "id": 1811681,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=c00b5e777fdca347",
            "url": "https://translate-dev.freebsd.org/api/units/1811681/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.213184Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Interrupts pose a problem with regards to spin mutexes. If a low-level interrupt handler needs a lock, it needs to not interrupt any code needing that lock to avoid possible data structure corruption. Currently, providing this mechanism is piggybacked onto critical section API by means of the `cpu_critical_enter` and `cpu_critical_exit` functions. Currently this API disables and re-enables interrupts on all of FreeBSD's current platforms. This approach may not be purely optimal, but it is simple to understand and simple to get right. Theoretically, this second API need only be used for spin mutexes that are used in primary interrupt context. However, to make the code simpler, it is used for all spin mutexes and even all critical sections. It may be desirable to split out the MD API from the MI API and only use it in conjunction with the MI API in the spin mutex implementation. If this approach is taken, then the MD API likely would need a rename to show that it is a separate API."
            ],
            "previous_source": "",
            "target": [
                "Прерывания создают проблему для спин-мьютексов. Если обработчик низкоуровневого прерывания требует блокировки, он не должен прерывать любой код, которому нужна эта блокировка, чтобы избежать возможного повреждения структур данных. В настоящее время этот механизм реализован через API критических секций с помощью функций `cpu_critical_enter` и `cpu_critical_exit`. Сейчас этот API отключает и снова включает прерывания на всех текущих платформах FreeBSD. Такой подход может быть не идеально оптимальным, но он прост для понимания и надежен в реализации. Теоретически, этот второй API нужен только для спин-мьютексов, используемых в основном контексте прерываний. Однако, для упрощения кода, он используется для всех спин-мьютексов и даже для всех критических секций. Возможно, стоит отделить MD API от MI API и использовать его только совместно с MI API в реализации спин-мьютексов. Если будет принят такой подход, то MD API, вероятно, потребуется переименовать, чтобы показать, что это отдельный API."
            ],
            "id_hash": 75582939216119995,
            "content_hash": 75582939216119995,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:128",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 38,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 169,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134236/?format=api",
            "priority": 100,
            "id": 1811682,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=810c8648630e88bb",
            "url": "https://translate-dev.freebsd.org/api/units/1811682/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.213820Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Design Tradeoffs"
            ],
            "previous_source": "",
            "target": [
                "Компромиссы проектирования"
            ],
            "id_hash": -7663982619355991287,
            "content_hash": -7663982619355991287,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:129",
            "context": "",
            "note": "type: Title ====",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 39,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 2,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134238/?format=api",
            "priority": 100,
            "id": 1811683,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=15a41069c884b309",
            "url": "https://translate-dev.freebsd.org/api/units/1811683/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.214525Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "As mentioned earlier, a couple of trade-offs have been made to sacrifice cases where perfect preemption may not always provide the best performance."
            ],
            "previous_source": "",
            "target": [
                "Как упоминалось ранее, были сделаны некоторые компромиссы, чтобы пожертвовать случаями, когда идеальная вытесняющая многозадачность не всегда обеспечивает наилучшую производительность."
            ],
            "id_hash": -1147960678977475574,
            "content_hash": -1147960678977475574,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:132",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 40,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 23,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134240/?format=api",
            "priority": 100,
            "id": 1811684,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=70119fd8396e6c0a",
            "url": "https://translate-dev.freebsd.org/api/units/1811684/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.215080Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The first trade-off is that the preemption code does not take other CPUs into account. Suppose we have a two CPU's A and B with the priority of A's thread as 4 and the priority of B's thread as 2. If CPU B makes a thread with priority 1 runnable, then in theory, we want CPU A to switch to the new thread so that we will be running the two highest priority runnable threads. However, the cost of determining which CPU to enforce a preemption on as well as actually signaling that CPU via an IPI along with the synchronization that would be required would be enormous. Thus, the current code would instead force CPU B to switch to the higher priority thread. Note that this still puts the system in a better position as CPU B is executing a thread of priority 1 rather than a thread of priority 2."
            ],
            "previous_source": "",
            "target": [
                "Первый компромисс заключается в том, что код вытеснения не учитывает другие процессоры. Предположим, у нас есть два процессора A и B, где приоритет потока A равен 4, а приоритет потока B равен 2. Если процессор B делает поток с приоритетом 1 готовым к выполнению, то теоретически мы хотим, чтобы процессор A переключился на новый поток, чтобы выполнялись два потока с наивысшим приоритетом. Однако стоимость определения, на какой процессор нужно применить вытеснение, а также фактическая сигнализация этому процессору через IPI вместе с необходимой синхронизацией были бы огромными. Таким образом, текущий код вместо этого заставит процессор B переключиться на поток с более высоким приоритетом. Заметим, что это всё равно улучшает состояние системы, так как процессор B выполняет поток с приоритетом 1, а не поток с приоритетом 2."
            ],
            "id_hash": 200729215914738445,
            "content_hash": 200729215914738445,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:134",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 41,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 152,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134242/?format=api",
            "priority": 100,
            "id": 1811685,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=82c922288aa4030d",
            "url": "https://translate-dev.freebsd.org/api/units/1811685/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.215695Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The second trade-off limits immediate kernel preemption to real-time priority kernel threads. In the simple case of preemption defined above, a thread is always preempted immediately (or as soon as a critical section is exited) if a higher priority thread is made runnable. However, many threads executing in the kernel only execute in a kernel context for a short time before either blocking or returning to userland. Thus, if the kernel preempts these threads to run another non-realtime kernel thread, the kernel may switch out the executing thread just before it is about to sleep or execute. The cache on the CPU must then adjust to the new thread. When the kernel returns to the preempted thread, it must refill all the cache information that was lost. In addition, two extra context switches are performed that could be avoided if the kernel deferred the preemption until the first thread blocked or returned to userland. Thus, by default, the preemption code will only preempt immediately if the higher priority thread is a real-time priority thread."
            ],
            "previous_source": "",
            "target": [
                "Второй компромисс ограничивает немедленное вытеснение ядра только потоками ядра с реальным временем. В простом случае вытеснения, описанном выше, поток всегда вытесняется немедленно (или как только будет покинута критическая секция), если становится доступным поток с более высоким приоритетом. Однако многие потоки, выполняющиеся в ядре, работают в контексте ядра лишь короткое время перед тем, как либо заблокироваться, либо вернуться в пользовательское пространство. Таким образом, если ядро вытеснит эти потоки для выполнения другого потока ядра без реального времени, оно может переключиться с выполняемого потока как раз перед тем, как тот собирается завершиться или перейти в режим ожидания. Кэш процессора должен затем адаптироваться к новому потоку. Когда ядро возвращается к вытесненному потоку, оно должно восстановить все потерянные кэшированные данные. Кроме того, выполняются два дополнительных переключения контекста, которых можно было бы избежать, если бы ядро отложило вытеснение до момента, пока первый поток не заблокируется или не вернётся в пользовательское пространство. Таким образом, по умолчанию код вытеснения будет немедленно вытеснять поток только в том случае, если поток с более высоким приоритетом имеет приоритет реального времени."
            ],
            "id_hash": 3484355505268437952,
            "content_hash": 3484355505268437952,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:136",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 42,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 174,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134244/?format=api",
            "priority": 100,
            "id": 1811686,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=b05aeadf02b3b3c0",
            "url": "https://translate-dev.freebsd.org/api/units/1811686/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.216405Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Turning on full kernel preemption for all kernel threads has value as a debugging aid since it exposes more race conditions. It is especially useful on UP systems were many races are hard to simulate otherwise. Thus, there is a kernel option `FULL_PREEMPTION` to enable preemption for all kernel threads that can be used for debugging purposes."
            ],
            "previous_source": "",
            "target": [
                "Включение полной вытесняющей многозадачности для всех потоков ядра полезно в качестве средства отладки, так как позволяет выявить больше состояний гонки. Это особенно полезно на однопроцессорных системах (UP), где многие гонки сложно воспроизвести другими способами. Таким образом, существует опция ядра `FULL_PREEMPTION` для включения вытеснения для всех потоков ядра, которая может использоваться для целей отладки."
            ],
            "id_hash": -6881994066883189399,
            "content_hash": -6881994066883189399,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:138",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 43,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 57,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134246/?format=api",
            "priority": 100,
            "id": 1811687,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=207e3edbc914e569",
            "url": "https://translate-dev.freebsd.org/api/units/1811687/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.217134Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Thread Migration"
            ],
            "previous_source": "",
            "target": [
                "Миграция потоков"
            ],
            "id_hash": -3832919050119234645,
            "content_hash": -3832919050119234645,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:139",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 44,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 2,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134248/?format=api",
            "priority": 100,
            "id": 1811688,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=4acebc6e7cd0bbab",
            "url": "https://translate-dev.freebsd.org/api/units/1811688/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.217740Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Simply put, a thread migrates when it moves from one CPU to another. In a non-preemptive kernel this can only happen at well-defined points such as when calling `msleep` or returning to userland. However, in the preemptive kernel, an interrupt can force a preemption and possible migration at any time. This can have negative affects on per-CPU data since with the exception of `curthread` and `curpcb` the data can change whenever you migrate. Since you can potentially migrate at any time this renders unprotected per-CPU data access rather useless. Thus it is desirable to be able to disable migration for sections of code that need per-CPU data to be stable."
            ],
            "previous_source": "",
            "target": [
                "Простыми словами, поток мигрирует, когда переходит с одного CPU на другой. В неперемещаемом ядре это может происходить только в определённых точках, например, при вызове `msleep` или возврате в пользовательское пространство. Однако в перемещаемом ядре прерывание может вызвать вытеснение и возможную миграцию в любой момент. Это может негативно сказаться на данных, специфичных для CPU, поскольку, за исключением `curthread` и `curpcb`, данные могут изменяться при любой миграции. Поскольку потенциально миграция может произойти в любой момент, это делает незащищённый доступ к данным, специфичным для CPU, практически бесполезным. Поэтому желательно иметь возможность отключать миграцию для участков кода, где требуется стабильность данных, специфичных для CPU."
            ],
            "id_hash": 5639549270827207817,
            "content_hash": 5639549270827207817,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:142",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 45,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 110,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134250/?format=api",
            "priority": 100,
            "id": 1811689,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=ce43b42ea4f80c89",
            "url": "https://translate-dev.freebsd.org/api/units/1811689/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.218291Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Critical sections currently prevent migration since they do not allow context switches. However, this may be too strong of a requirement to enforce in some cases since a critical section also effectively blocks interrupt threads on the current processor. As a result, another API has been provided to allow the current thread to indicate that if it preempted it should not migrate to another CPU."
            ],
            "previous_source": "",
            "target": [
                "Критические секции в настоящее время предотвращают миграцию, поскольку они не допускают переключения контекстов. Однако это может быть слишком строгим требованием в некоторых случаях, так как критическая секция также эффективно блокирует потоки прерываний на текущем процессоре. В результате был предоставлен другой API, позволяющий текущему потоку указать, что если он будет вытеснен, он не должен мигрировать на другой CPU."
            ],
            "id_hash": -2910145824166334305,
            "content_hash": -2910145824166334305,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:144",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 46,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 65,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134252/?format=api",
            "priority": 100,
            "id": 1811690,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=579d15caa1fab09f",
            "url": "https://translate-dev.freebsd.org/api/units/1811690/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.218954Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "This API is known as thread pinning and is provided by the scheduler. The API consists of two functions: `sched_pin` and `sched_unpin`. These functions manage a per-thread nesting count `td_pinned`. A thread is pinned when its nesting count is greater than zero and a thread starts off unpinned with a nesting count of zero. Each scheduler implementation is required to ensure that pinned threads are only executed on the CPU that they were executing on when the `sched_pin` was first called. Since the nesting count is only written to by the thread itself and is only read by other threads when the pinned thread is not executing but while `sched_lock` is held, then `td_pinned` does not need any locking. The `sched_pin` function increments the nesting count and `sched_unpin` decrements the nesting count. Note that these functions only operate on the current thread and bind the current thread to the CPU it is executing on at the time. To bind an arbitrary thread to a specific CPU, the `sched_bind` and `sched_unbind` functions should be used instead."
            ],
            "previous_source": "",
            "target": [
                "Этот API известен как закрепление потока и предоставляется планировщиком. API состоит из двух функций: `sched_pin` и `sched_unpin`. Эти функции управляют счетчиком вложенности `td_pinned` для каждого потока. Поток считается закрепленным, когда его счетчик вложенности больше нуля, и прекращает быть закрепленным с нулевым счетчиком вложенности. Каждая реализация планировщика должна гарантировать, что закрепленные потоки выполняются только на том CPU, на котором они выполнялись при первом вызове `sched_pin`. Поскольку счетчик вложенности изменяется только самим потоком и читается другими потоками только тогда, когда закрепленный поток не выполняется, но удерживается `sched_lock`, то `td_pinned` не требует блокировки. Функция `sched_pin` увеличивает счетчик вложенности, а `sched_unpin` уменьшает его. Обратите внимание, что эти функции работают только с текущим потоком и привязывают текущий поток к CPU, на котором он выполняется в данный момент. Для привязки произвольного потока к определённому CPU следует использовать функции `sched_bind` и `sched_unbind`."
            ],
            "id_hash": 6114234319276565654,
            "content_hash": 6114234319276565654,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:146",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 47,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 175,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134254/?format=api",
            "priority": 100,
            "id": 1811691,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=d4da1fb801fb6496",
            "url": "https://translate-dev.freebsd.org/api/units/1811691/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.219575Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "Callouts"
            ],
            "previous_source": "",
            "target": [
                "Обратные вызовы"
            ],
            "id_hash": 1068506298222368858,
            "content_hash": 1068506298222368858,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:147",
            "context": "",
            "note": "type: Title ===",
            "flags": "no-wrap",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 48,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 1,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134256/?format=api",
            "priority": 100,
            "id": 1811692,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=8ed418d129cfd85a",
            "url": "https://translate-dev.freebsd.org/api/units/1811692/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.220260Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The `timeout` kernel facility permits kernel services to register functions for execution as part of the `softclock` software interrupt. Events are scheduled based on a desired number of clock ticks, and callbacks to the consumer-provided function will occur at approximately the right time."
            ],
            "previous_source": "",
            "target": [
                "Функция ядра `timeout` позволяет службам ядра регистрировать функции для выполнения в рамках программного прерывания `softclock`. События планируются на основе заданного количества тактов часов, и вызовы предоставленной потребителем функции будут происходить приблизительно в нужное время."
            ],
            "id_hash": -2117495943706672038,
            "content_hash": -2117495943706672038,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:150",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 49,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 43,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134258/?format=api",
            "priority": 100,
            "id": 1811693,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=629d24a87e08845a",
            "url": "https://translate-dev.freebsd.org/api/units/1811693/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.220870Z"
        },
        {
            "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbooksmp_index/ru/?format=api",
            "source": [
                "The global list of pending timeout events is protected by a global spin mutex, `callout_lock`; all access to the timeout list must be performed with this mutex held. When `softclock` is woken up, it scans the list of pending timeouts for those that should fire. In order to avoid lock order reversal, the `softclock` thread will release the `callout_lock` mutex when invoking the provided `timeout` callback function. If the `CALLOUT_MPSAFE` flag was not set during registration, then Giant will be grabbed before invoking the callout, and then released afterwards. The `callout_lock` mutex will be re-grabbed before proceeding. The `softclock` code is careful to leave the list in a consistent state while releasing the mutex. If `DIAGNOSTIC` is enabled, then the time taken to execute each function is measured, and a warning is generated if it exceeds a threshold."
            ],
            "previous_source": "",
            "target": [
                "Глобальный список ожидающих событий с таймаутом защищен глобальной спин-блокировкой `callout_lock`; любой доступ к списку таймаутов должен выполняться с удержанием этой блокировки. Когда `softclock` пробуждается, он сканирует список ожидающих таймаутов на предмет тех, которые должны сработать. Чтобы избежать инверсии блокировок, поток `softclock` освобождает блокировку `callout_lock` при вызове предоставленной функции обратного вызова `timeout`. Если флаг `CALLOUT_MPSAFE` не был установлен во время регистрации, то `Giant` будет захвачен перед вызовом обратного вызова, а затем освобожден после него. Блокировка `callout_lock` будет повторно захвачена перед продолжением работы. Код `softclock` аккуратно поддерживает список в согласованном состоянии во время освобождения блокировки. Если включен `DIAGNOSTIC`, то измеряется время выполнения каждой функции, и если оно превышает пороговое значение, генерируется предупреждение."
            ],
            "id_hash": 8089060480249487509,
            "content_hash": 8089060480249487509,
            "location": "documentation/content/en/books/arch-handbook/smp/_index.adoc:152",
            "context": "",
            "note": "type: Plain text",
            "flags": "",
            "labels": [],
            "state": 20,
            "fuzzy": false,
            "translated": true,
            "approved": false,
            "position": 50,
            "has_suggestion": false,
            "has_comment": false,
            "has_failing_check": false,
            "num_words": 138,
            "source_unit": "https://translate-dev.freebsd.org/api/units/1134260/?format=api",
            "priority": 100,
            "id": 1811694,
            "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbooksmp_index/ru/?checksum=f0421da62bebe095",
            "url": "https://translate-dev.freebsd.org/api/units/1811694/?format=api",
            "explanation": "",
            "extra_flags": "",
            "pending": false,
            "timestamp": "2025-05-25T08:25:10.221479Z"
        }
    ]
}