3proxy/tests/cases
Vladimir Dubrovin 4e1455b419 Fibers: stacks a thread switches to and back
src/fiber.c, not used yet: a fiber runs a function on a stack of its
own, yielding back to the thread which resumed it, for a thread to
serve many clients with code written as if each had a thread.

The switch is our own on x86-64 (System V), aarch64, i386, arm (ARM or
Thumb code, with or without a floating point unit) and mips o32 (with
soft, 32 or 64 bit floating point registers, position independent or
not), Windows' fibers on Windows. It saves the registers a function
has to keep and swaps the stack. Elsewhere there are no fibers
(WITH_FIBERS is not defined), nor where x86-64 Linux checks returns
against a shadow stack, which fiberusable() tells: each client has a
thread there.

Stacks are mapped with a guard page below them. A fiber whose function
returned is started again with another, its stack kept. Switches are
annotated for AddressSanitizer.

tests/fibertest.c tests them: yielding and resuming, the integer and
floating point registers a function keeps across switches both ways, a
thousand fibers resumed at random each keeping its stack, recursion
deep in a stack, fibers sleeping on the event loop's timers. The units
case, which was the loop case, runs it with looptest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 21:51:40 +03:00
..
admin.py Name the HTTPSRV service in the string table 2026-10-15 15:36:13 +03:00
auto.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
counters.py Keep the values of numbered traffic counters across reloads 2026-10-13 19:05:59 +03:00
dnspr.py Fix dnspr for Windows 2026-08-26 16:28:27 +03:00
httpsrv_auth.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
httpsrv_files.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
httpsrv_keepalive.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
httpsrv_ops.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
httpsrv_parsing.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
httpsrv_proxypass.py support proxypass in web server 2026-08-27 17:57:51 +03:00
httpsrv_rules.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
ipv6.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
ktls.py splice() over kernel TLS 2026-10-14 18:50:02 +03:00
logs.py Logs: a thread and a queue for each log; build-time defaults 2026-10-23 19:41:48 +03:00
maxconn.py Change waiting loops to semaphores for child counters 2026-10-10 23:10:57 +03:00
parent_failover.py parent: support fraction and % syntaxis for weight; support fallbacks with 0 weight 2026-09-16 20:04:10 +03:00
parent_ports.py tests: parent_ports tells an ephemeral port from the window by several 2026-10-18 12:58:43 +03:00
parent_weights.py parent: support fraction and % syntaxis for weight; support fallbacks with 0 weight 2026-09-16 20:04:10 +03:00
pcre.py Fix rewrite and over-long header handling on Windows 2026-08-29 20:21:29 +03:00
portmap.py tests: run the half-close case on Windows again 2026-10-13 12:57:50 +03:00
proxy_headers.py proxy: request line logged up to 4 KB, added headers written in place 2026-10-19 11:20:45 +03:00
proxy_http.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
reattach.py connect back: a replaced -r service stops waiting at the reload 2026-10-19 16:28:02 +03:00
reload.py tests: reload cases that hold on slow runners 2026-10-18 11:25:07 +03:00
socks.py tests: SOCKS BIND 2026-10-24 20:54:51 +03:00
splice.py Make the automatic splice() mode's heuristics a service option 2026-10-14 19:02:23 +03:00
ssl.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
sysdns.py resolver: per service, defaultresolve, fakeresolve or sysresolve 2026-10-21 18:45:48 +03:00
takeover.py tests: reload cases that hold on slow runners 2026-10-18 11:25:07 +03:00
timeouts.py per-service timeouts 2026-10-13 15:12:05 +03:00
tlspr.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
transparent.py http server implemented, pcre support for hostnames in acls implemented 2026-08-27 14:34:27 +03:00
udploop.py Tests: udploop's silence counted from the last answer 2026-10-23 13:56:38 +03:00
units.py Fibers: stacks a thread switches to and back 2026-10-24 21:51:40 +03:00
unixsock.py Unix sockets: remove on closing only the file this socket bound 2026-10-18 12:38:11 +03:00