mORMot2 DailyЕжедневный обзор коммитов апстрима

Нативный futex для TOSLightLock и исправление взаимоблокировки ICU

Сегодняшние коммиты серьёзно меняют примитивы синхронизации в ядре mORMot 2. TOSLightLock теперь использует нативный futex в Linux и WaitOnAddress в Windows 8+, что должно заметно помочь при конкуренции. Также исправлена взаимоблокировка в библиотеке ICU, а в асинхронный сетевой опрос добавлена проверка границ.

Коротко

  • TOSLightLock использует нативный futex в Linux и WaitOnAddress в Windows 8+.
  • TIcuLibrary исправляет взаимоблокировку при создании общего конвертера.
  • TAsyncConnections исправляет возможный выход за границы при опросе потоков.
  • Механизмы адаптивного ожидания вынесены в модуль core base.

Рекомендации по обновлению

Teams pushing heavy multithreaded workloads on Linux or Windows 8+ should benefit from the TOSLightLock upgrade. The ICU deadlock fix is recommended for applications dealing with internationalization.

Сборка2.4.16618 → 2.4.16628
Коммиты10
Строки+404 -312
Чтение2 мин

10 из 10 записей · 10 коммитов в апстриме

Сюжеты
# Запись Категория Модули
1 Высокий Исправлена взаимоблокировка при загрузке конвертеров ICU Corrects the unlock logic in TIcuLibrary.SharedUcnvGet(). The previous code mistakenly released a converter-specific lock instead of the main library lock after populating the converter cache. Исправления mormot.core.os 87dbb9fc+3-3

core: fix deadlock in TIcuLibrary

Влияние

Предотвращает взаимоблокировки, когда несколько потоков одновременно запрашивают конвертер текста у библиотеки ICU.

Модули

Arnaud · 21:44 UTC · открыть коммит на GitHub →

2 Высокий TOSLightLock uses WaitOnAddress on Windows 8+ Upgrades TOSLightLock on Windows to use the WaitOnAddress and WakeByAddressSingle API (introduced in Windows 8), moving away from Slim Reader/Writer (SRW) locks. Производительность mormot.core.os+3 17a26fa9+106-124

core: TOSLightLock now uses WaitOnAddress/WakeByAddressSingle on Win8+

Влияние

Faster lock acquisition on Windows 8 and newer, especially under high contention, by avoiding SRW lock overhead.

Arnaud Bouchez · 19:39 UTC · открыть коммит на GitHub →

3 Высокий TOSLightLock upgraded to use native futex on Linux Replaces the underlying Linux implementation of TOSLightLock with a direct 32-bit futex syscall instead of a TRTLCriticalSection. It falls back to spin-and-wait on older kernels. Производительность mormot.core.os 64d1d6db+106-23

core: TOsLightLock uses a futex on Linux

Влияние

Significantly improves requests-per-second and threading stability on Linux backends. It is now as fast as TLightLock on the uncontended fast path.

Модули

Arnaud Bouchez · 17:29 UTC · открыть коммит на GitHub →

4 Средний Fixed TOSLightLock fallback on Android and Delphi POSIX Restores the TRTLCriticalSection fallback for TOSLightLock on platforms without native futex or pthread_mutex support, like Android and Delphi POSIX. The previous commits inadvertently broke this fallback. Исправления mormot.core.os+1 cabcd0ec+41-40

core: another pass of TOsLightLock

Влияние

Applications running on Android or compiled with Delphi for POSIX will compile and run correctly again. No impact on Windows or FPC Linux.

Arnaud · 22:35 UTC · открыть коммит на GitHub →

5 Средний Fixed late loading of Windows 8 synchronization API Moves the runtime loading of API-MS-Win-Core-Synch-l1-2-0.dll to happen after the OS version has been properly populated into OSVersion32. Исправления mormot.core.os a426a84d+14-14

core: fixed API-MS-Win-Core-Synch-l1-2-0.dll loading

Влияние

Resolves a bug where the new futex API was not initialized correctly on modern Windows versions because the version check failed at initialization time.

Модули

Arnaud Bouchez · 19:41 UTC · открыть коммит на GitHub →

6 Средний Fixed potential bounds error in asynchronous connections Updates TAsyncConnections.ThreadPollingWakeupLocked to check for <= 0 instead of exactly 0 when inspecting spare events. Исправления mormot.net.async 440d9e9d+3-3

net: fixed potential out of range in TAsyncConnections.ThreadPollingWakeupLocked;

Влияние

Prevents potential out-of-range errors or negative event counters from causing issues in the async polling thread loop.

Модули

Arnaud Bouchez · 17:33 UTC · открыть коммит на GitHub →

7 Низкий Published a raw DoPause procedure Extracts the CPU pause logic (the pause opcode on x86, yield on ARM) into a globally available DoPause procedure in mormot.core.base. Новые возможности mormot.core.base 4cd5cff1+17-2

core: let publish a raw DoPause procedure

Влияние

Developers can now explicitly call DoPause in custom spin loops to reduce CPU power consumption and cache traffic.

Публичный API

  • DoPauseadded — A cross-platform procedure that invokes CPU pause or yield instructions.

Модули

Arnaud Bouchez · 17:28 UTC · открыть коммит на GitHub →

8 Низкий Moved NextSpin to mormot.core.base Moves the adaptive spin-wait function NextSpin() and its associated SPIN_FACTOR and SPIN_COUNT constants from mormot.core.os into the lower-level mormot.core.base unit. Внутреннее устройство mormot.core.base+1 268d8600+91-85

core: moved NextSpin() to mormot.core.base

Влияние

No direct impact on application code. It allows simpler units without OS dependencies to use the adaptive spin logic.

Arnaud Bouchez · 17:27 UTC · открыть коммит на GitHub →

9 Низкий Refactored TIcuLibrary internal locking fields Changes the internal locking fields in TIcuLibrary from PtrUInt to cardinal to match the expected types for TLightLock primitives. Внутреннее устройство mormot.core.os 1f1fe8df+17-12

core: fixed TIcuLibrary locking code

Влияние

No impact on application code, internal refactoring only.

Модули

Arnaud Bouchez · 19:45 UTC · открыть коммит на GitHub →

10 Низкий Updated TOSLightLock usage comments Updates code comments referencing TOSLightLock across several units to reflect the new Windows 8+ and Linux futex behaviors. Обслуживание mormot.core.mvc+3 043d364d+6-6

core: fixed TOSLightLock usage comments in code

Влияние

No impact on application code, internal refactoring only.

Arnaud Bouchez · 17:33 UTC · открыть коммит на GitHub →

Активность апстрима коммитов в день · последние 60 дней
Коммиты1007
Активных дней49/60
Пик активности2026-09-30
Максимум60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28