Hi everyone. I have completed the research on PHP core changes for multithreaded programming. The article briefly presents the main benefits of PHP multithreading: thread pools and actors. https://github.com/true-async/multithreaded-php/blob/main/mm-en.md
This research makes it possible to look into a potential timeline of PHP’s evolution and imagine how the current RFC could interact with multithreading abstractions. The article examines how threads and actors can interact with coroutines. As for my personal opinion. I believe that actors are the safest and most sustainable pattern for the PHP language. They are much better than manual thread management and better than interacting with a thread pool. PHP should evolve toward higher-level abstractions that are not tied to OS-specific details. I am convinced that the presence of low-level APIs in PHP that mirror C functions is a historical design mistake that should be phased out. Actors allow writing sequential code without thinking about multithreading or thread pools. This is a solid tool with proven effectiveness and well-known trade-offs, focused on business logic. That is why actors are a perfect fit for PHP. A single-threaded coroutine model fits actors very well, creating the necessary illusion of sequential execution. The current amount of research, experimentation, and knowledge should be sufficient to make a well-balanced decision. Best regards, Ed
