> **Источник:** https://python-all.ru/2.7/library/someos.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# 16. Необязательные службы операционной системы

Модули, описанные в этой главе, предоставляют интерфейсы к функциям операционной системы, доступным только на отдельных операционных системах. Обычно эти интерфейсы основаны на интерфейсах Unix или C, но они также доступны на некоторых других системах (например, Windows или NT). Вот обзор:

- [16.1. `select` – Ожидание завершения ввода-вывода](https://python-all.ru/2.7/library/select.html)

  - [16.1.1. Объекты опроса по переднему фронту и по уровню (epoll)](https://python-all.ru/2.7/library/select.html#edge-and-level-trigger-polling-epoll-objects)
  - [16.1.2. Объекты опроса](https://python-all.ru/2.7/library/select.html#polling-objects)
  - [16.1.3. Объекты kqueue](https://python-all.ru/2.7/library/select.html#kqueue-objects)
  - [16.1.4. Объекты kevent](https://python-all.ru/2.7/library/select.html#kevent-objects)
- [16.2. `threading` – Интерфейс потоков высокого уровня](https://python-all.ru/2.7/library/threading.html)

  - [16.2.1. Объекты потоков](https://python-all.ru/2.7/library/threading.html#thread-objects)
  - [16.2.2. Объекты блокировок](https://python-all.ru/2.7/library/threading.html#lock-objects)
  - [16.2.3. Объекты RLock](https://python-all.ru/2.7/library/threading.html#rlock-objects)
  - [16.2.4. Объекты Condition](https://python-all.ru/2.7/library/threading.html#condition-objects)
  - [16.2.5. Объекты семафоров](https://python-all.ru/2.7/library/threading.html#semaphore-objects)

    - [16.2.5.1. `Semaphore` Пример](https://python-all.ru/2.7/library/threading.html#semaphore-example)
  - [16.2.6. Объекты событий](https://python-all.ru/2.7/library/threading.html#event-objects)
  - [16.2.7. Объекты таймеров](https://python-all.ru/2.7/library/threading.html#timer-objects)
  - [16.2.8. Использование блокировок, условий и семафоров в операторе `with`](https://python-all.ru/2.7/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement)
  - [16.2.9. Импорт в многопоточном коде](https://python-all.ru/2.7/library/threading.html#importing-in-threaded-code)
- [16.3. `thread` – Множественные потоки управления](https://python-all.ru/2.7/library/thread.html)
- [16.4. `dummy_threading` – Прямая замена модуля `threading`](https://python-all.ru/2.7/library/dummy_threading.html)
- [16.5. `dummy_thread` – Прямая замена модуля `thread`](https://python-all.ru/2.7/library/dummy_thread.html)
- [16.6. `multiprocessing` – Интерфейс «потоков» на основе процессов](https://python-all.ru/2.7/library/multiprocessing.html)

  - [16.6.1. Введение](https://python-all.ru/2.7/library/multiprocessing.html#introduction)

    - [16.6.1.1. Класс `Process`](https://python-all.ru/2.7/library/multiprocessing.html#the-process-class)
    - [16.6.1.2. Обмен объектами между процессами](https://python-all.ru/2.7/library/multiprocessing.html#exchanging-objects-between-processes)
    - [16.6.1.3. Синхронизация между процессами](https://python-all.ru/2.7/library/multiprocessing.html#synchronization-between-processes)
    - [16.6.1.4. Совместное использование состояния между процессами](https://python-all.ru/2.7/library/multiprocessing.html#sharing-state-between-processes)
    - [16.6.1.5. Использование пула рабочих процессов](https://python-all.ru/2.7/library/multiprocessing.html#using-a-pool-of-workers)
  - [16.6.2. Справочник](https://python-all.ru/2.7/library/multiprocessing.html#reference)

    - [16.6.2.1. `Process` и исключения](https://python-all.ru/2.7/library/multiprocessing.html#process-and-exceptions)
    - [16.6.2.2. Каналы и очереди](https://python-all.ru/2.7/library/multiprocessing.html#pipes-and-queues)
    - [16.6.2.3. Разное](https://python-all.ru/2.7/library/multiprocessing.html#miscellaneous)
    - [16.6.2.4. Объекты соединений](https://python-all.ru/2.7/library/multiprocessing.html#connection-objects)
    - [16.6.2.5. Примитивы синхронизации](https://python-all.ru/2.7/library/multiprocessing.html#synchronization-primitives)
    - [16.6.2.6. Разделяемые объекты `ctypes`](https://python-all.ru/2.7/library/multiprocessing.html#shared-ctypes-objects)

      - [16.6.2.6.1. Модуль `multiprocessing.sharedctypes`](https://python-all.ru/2.7/library/multiprocessing.html#module-multiprocessing.sharedctypes)
    - [16.6.2.7. Менеджеры](https://python-all.ru/2.7/library/multiprocessing.html#managers)

      - [16.6.2.7.1. Настраиваемые менеджеры](https://python-all.ru/2.7/library/multiprocessing.html#customized-managers)
      - [16.6.2.7.2. Использование удалённого менеджера](https://python-all.ru/2.7/library/multiprocessing.html#using-a-remote-manager)
    - [16.6.2.8. Прокси-объекты](https://python-all.ru/2.7/library/multiprocessing.html#proxy-objects)

      - [16.6.2.8.1. Очистка](https://python-all.ru/2.7/library/multiprocessing.html#cleanup)
    - [16.6.2.9. Пулы процессов](https://python-all.ru/2.7/library/multiprocessing.html#module-multiprocessing.pool)
    - [16.6.2.10. Прослушиватели и клиенты](https://python-all.ru/2.7/library/multiprocessing.html#module-multiprocessing.connection)

      - [16.6.2.10.1. Форматы адресов](https://python-all.ru/2.7/library/multiprocessing.html#address-formats)
    - [16.6.2.11. Ключи аутентификации](https://python-all.ru/2.7/library/multiprocessing.html#authentication-keys)
    - [16.6.2.12. Логирование](https://python-all.ru/2.7/library/multiprocessing.html#logging)
    - [16.6.2.13. Модуль `multiprocessing.dummy`](https://python-all.ru/2.7/library/multiprocessing.html#module-multiprocessing.dummy)
  - [16.6.3. Рекомендации по программированию](https://python-all.ru/2.7/library/multiprocessing.html#programming-guidelines)

    - [16.6.3.1. Все платформы](https://python-all.ru/2.7/library/multiprocessing.html#all-platforms)
    - [16.6.3.2. Windows](https://python-all.ru/2.7/library/multiprocessing.html#windows)
  - [16.6.4. Примеры](https://python-all.ru/2.7/library/multiprocessing.html#examples)
- [16.7. `mmap` – Поддержка файлов с отображением в память](https://python-all.ru/2.7/library/mmap.html)
- [16.8. `readline` – Интерфейс GNU readline](https://python-all.ru/2.7/library/readline.html)

  - [16.8.1. Файл инициализации](https://python-all.ru/2.7/library/readline.html#init-file)
  - [16.8.2. Буфер строки](https://python-all.ru/2.7/library/readline.html#line-buffer)
  - [16.8.3. Файл истории](https://python-all.ru/2.7/library/readline.html#history-file)
  - [16.8.4. Список истории](https://python-all.ru/2.7/library/readline.html#history-list)
  - [16.8.5. Хуки запуска](https://python-all.ru/2.7/library/readline.html#startup-hooks)
  - [16.8.6. Автодополнение](https://python-all.ru/2.7/library/readline.html#completion)
  - [16.8.7. Пример](https://python-all.ru/2.7/library/readline.html#example)
- [16.9. `rlcompleter` – Функция автодополнения для GNU readline](https://python-all.ru/2.7/library/rlcompleter.html)

  - [16.9.1. Объекты автодополнения](https://python-all.ru/2.7/library/rlcompleter.html#completer-objects)
