Concurrency¶
Concurrency is a concept in computing where multiple tasks are in progress at the same time.
PHP uses several ways to handle concurrency:
Externally, by the webserver or PHP-fpm
Internally, with forked processes, with pcntl
Internally, with threads, with parallel
Cooperating, with fibers
Non-blocking IO, with swoole or amphp.
See also FrankenPHP, swoole, OpenSwoole project, AMPHP, Understanding Concurrency in PHP, Understanding Fibers in PHP: A New Way to Handle Concurrency and PHP is 5x Faster Than NestJS? Rethinking High-Load with Swoole.
Related : Thread, Process, Asynchronous, FastCGI Process Manager (FPM), Atomic Operation, file_put_contents(), Mutex, Race Condition, Actor Model, Cache Stampede, Green Thread, Software Transactional Memory (STM), AMP (Asynchronous Markup Protocol), ReactPHP, Semaphore, Shared Memory, Shared