Re: [RFC] Concurrency Support in the PHP Engine
| From: | Edmond Dantes | Date: | Wed, 07 Oct 2026 10:17:33 +0000 |
| Subject: | Re: [RFC] Concurrency Support in the PHP Engine | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132826@lists.php.net to get a copy of this message | ||
Hello everyone
I’ve started integrating the codebase with the Scheduler API + Poll
API (https://discourse.thephp.foundation/t/php-dev-rfc-polling-api-additions/6158)
to test these RFCs for bugs.
The implementation is still fairly rough, but I think the situation
will change significantly over the next 2–3 months.
I’ll post an update here later with the results.
P.S. Heh, the bugs I’ve found so far were in completely different
modules as well. :)
чт, 23 июл. 2026 г. в 11:58, Edmond Dantes <edmond.ht@gmail.com>:
>
> Hi internals,
>
> I would like to open the discussion of a new RFC:
>
> https://wiki.php.net/rfc/async_scheduler_abi
>
> The proposal gives the engine a coroutine representation and makes the
> component that drives coroutines, the scheduler, pluggable by an
> extension. It adds no classes, no functions, no constants and no
> syntax: the engine compiles in no PHP symbols at all. With no scheduler
> registered, PHP behaves exactly as it does today.
>
> This is not the True Async RFC. It is the minimal engine core extracted
> from that work: the activation contract, the notifications the engine
> raises, adoption of fibers onto the scheduler, and per-coroutine
> storage. Any user-facing API (spawn(), await(), channels) stays in
> extension space; True Async is one possible provider on top, not the
> subject of this proposal.
>
> The implementation exists, and I am the one contributing it:
>
> https://github.com/php/php-src/pull/22561
>
> The PR carries the engine changes plus an in-tree reference scheduler
> (ext/test_scheduler, disabled by default) that fills every slot from an
> ordinary extension; the upstream test suites run unchanged and
> schedulerless in the same binary. A bridge extension that registers a
> scheduler written in plain PHP exists out of tree, as runtime proof
> that the seam is sufficient.
>
> Points likely of interest for existing code: a scheduler can adopt
> fibers started by ReactPHP, Revolt or AMPHP, per fiber and declinable;
> the proposal ships the per-coroutine storage that would later let
> ob_start() and friends become coroutine-safe; there are no goroutines
> and no parallelism, everything runs in one OS thread.
>
> Feedback is welcome.
>
> Regards,
> Edmond