DEV Community

Aldora
Aldora

Posted on

PHP has no support for threads

Notes from Advanced PHP Programming by George Schlossnagle:

  • PHP: no native support for multithreads
  • Alternative:pcntl_fork() creates child process
  • The moment pcntl_fork() called, a new process is created
  • In parent process, pcntl_fork() returns process ID of the newly created child, in the child, it returns 0.

More details here: Creating and Managing Child Processes

Top comments (2)

Collapse
 
maorkavod profile image
maorkavod

PHP has support for multithreads :
github.com/krakjoe/pthreads

Collapse
 
aldora profile image
Aldora

the key of this is that does php has native support for multithreads