Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
Taking advantage of multicore, you have to use multiple processes in you server or application. You can build multiple processes application easily with the features provided by Swoole.
Multiple processes can run simultaneously (without context-switching) in multi-core processors. You can create multiple Linux processes in several ways:
Worker
processes in Server
.Task Worker
processes in Server
.fork
or pcntl_fork
.Swoole Atomic
.KV
storage.wait
and wakeup
for synchronization.process
synchronization.Notice: process level synchronization should not be used within coroutine context