DEV Community

Aldora
Aldora

Posted on

1 1

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay