You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... under heading The coroutine scheduler design in PHP Swoole 4.x, it states that:
The coroutine scheduler in PHP Swoole 4.x is single thread design. Only one coroutine is parallel running, so there are no problems such as data syncing between threads and avoid locking.
I interpreted that as: it runs, only one of the co-routines, in an instance of time, in a single-threaded Worker Process by Swoole, however multiple co-routines may possibly be running parallel in separate worker processes.
However i am not having a clear idea in what manner Swoole is multi-threaded design, if it runs, one of the co-routines, in an instance of time, in a single-threaded Worker Process by Swoole.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There seem conflicting statements in official documentation which needs clarity.
On this link: Swoole HTTP Server
... under the heading Swoole Server Performance, it states:
Swoole runs more efficiently as it has a multi-threaded process model ...
But in another link, in comparison of Swoole with Go-lang here:
Coroutine in PHP Swoole 4.x vs Coroutine in Golang
... under heading The coroutine scheduler design in PHP Swoole 4.x, it states that:
The coroutine scheduler in PHP Swoole 4.x is single thread design. Only one coroutine is parallel running, so there are no problems such as data syncing between threads and avoid locking.
I interpreted that as:
it runs, only one of the co-routines, in an instance of time, in a single-threaded Worker Process by Swoole, however multiple co-routines may possibly be running parallel in separate worker processes.
However i am not having a clear idea in what manner Swoole is multi-threaded design, if it runs, one of the co-routines, in an instance of time, in a single-threaded Worker Process by Swoole.
Beta Was this translation helpful? Give feedback.
All reactions