mirror of
https://github.com/3proxy/3proxy.git
synced 2026-10-28 22:05:48 +08:00
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> |
||
|---|---|---|
| .. | ||
| admin.py | ||
| auto.py | ||
| counters.py | ||
| dnspr.py | ||
| httpsrv_auth.py | ||
| httpsrv_files.py | ||
| httpsrv_keepalive.py | ||
| httpsrv_ops.py | ||
| httpsrv_parsing.py | ||
| httpsrv_proxypass.py | ||
| httpsrv_rules.py | ||
| ipv6.py | ||
| ktls.py | ||
| logs.py | ||
| maxconn.py | ||
| parent_failover.py | ||
| parent_ports.py | ||
| parent_weights.py | ||
| pcre.py | ||
| portmap.py | ||
| proxy_headers.py | ||
| proxy_http.py | ||
| reattach.py | ||
| reload.py | ||
| socks.py | ||
| splice.py | ||
| ssl.py | ||
| sysdns.py | ||
| takeover.py | ||
| timeouts.py | ||
| tlspr.py | ||
| transparent.py | ||
| udploop.py | ||
| units.py | ||
| unixsock.py | ||