No description
  • PureBasic 100%
Find a file
René Linder 89ced086c7 v5.5.6: TLS/Data Worker auf eventfd-Wake — Idle-CPU 0% statt Polling
Pre-fix: TLSWorker und DataWorker hatten beide das Anti-Pattern
"If no work: Delay(1)" plus tls_epoll_timeout_ms=10. Bei Idle = ~1000
hrtimer_nanosleep wakes pro Sekunde pro Thread × 4-6 Worker. Ein
Konsument (PurePower Framework Plugin-IPC via Unix-Socket-Reactor)
sah 5-7% Process-CPU im Idle — nicht akzeptabel.

Architektur-Fix:
  TLSWorkerPool und DataWorkerPool bekommen je ein eventfd in
  Sem-Mode (EFD_SEMAPHORE). Producer (_SubmitTLSJob bzw. data-pool
  Push in NET_Core) macht write_(wakeup_fd, 1). Worker:

  TLSWorker: eventfd ist im pool\epoll_fd registriert. epoll_wait
    läuft jetzt mit timeout=-1 (unbegrenzt). Wakeup-Pfade:
      a) wakeup_fd-Event → read_ consumiert 1, Loop-Restart für Phase A
      b) TLS-FD-Event (Pending-Handshake-EPOLLONESHOT) → wie bisher
    EFD_SEMAPHORE garantiert Fairness bei mehreren Workers (read
    consumiert nur 1, andere bleiben blocked bis nächster write_).

  DataWorker: kein eigenes epoll, nutzt blocking read_(wakeup_fd).
    Sem-Mode → consumiert 1, fairness automatisch. Stop wakeup über
    write_ pro Worker.

Stop-Mechanismus:
  _ShutdownTLSPool / _ShutdownDataPool macht write_(wakeup_fd) für
  jeden Worker BEVOR WaitThread. Worker wacht, sieht running=#False,
  exit clean.

Removed:
  - Delay(1) im no-work-Fall (TLSWorker, DataWorker)
  - tls_epoll_timeout_ms ist jetzt legacy (config bleibt aber wird
    ignoriert; dokumentationsneutral). Default war 10ms; jetzt -1.

Tests: 645/649 grün (3 Suites). 1 pre-existing Fail in unix-sockets
Stale-Socket-Test ohne Worker-Pool-Bezug.

Compatibility: API-kompatibel. Submodule-Konsumenten profitieren
automatisch nach Update auf v5.5.6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:13:16 +02:00
atomic-ops.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
lock-free-queue.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Client.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Core.pbi v5.5.6: TLS/Data Worker auf eventfd-Wake — Idle-CPU 0% statt Polling 2026-04-26 11:13:16 +02:00
NET_Correlation.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Discovery.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Framing.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Metrics.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Multicast.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
NET_Server.pbi v5.5.6: TLS/Data Worker auf eventfd-Wake — Idle-CPU 0% statt Polling 2026-04-26 11:13:16 +02:00
NET_Shaping.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
quic-integration.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
quic-native.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
quic-perf.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
tls-dummy.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
tls-openssl.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00
UnixSocket.pbi Header-Cleanup V5.5.5: einheitlicher Copyright-Block, Per-File-Changelog raus 2026-04-24 07:46:59 +02:00