3 ms·
The needs aren't very exotic. You can use them any time you need to do multiprocessing, a common example is building a daemon to process a queue in parallel wit
by gnarcoregrizz 8y ago
The needs aren't very exotic. You can use them any time you need to do multiprocessing, a common example is building a daemon to process a queue in parallel with multiple workers.
Also, the pcntl functions don't provide multithreading primitives, only multiprocessing (fork)
Edit, looks like there is also a pthreads extension
- codedokode 8y agoBetter solution might be to run several daemon processes in parallel.
- Shish2k 8y ago> The needs aren't very exotic [...] a common example is building a daemon While "writing a daemon" is pretty common, I've never seen a daemon written in PHP (I'm sure they exist, I've just never seen one), so I would call that an exotic use-case :P
- aequitas 8y agoI had to maintain one, would not recommend it as a general pattern. Most of the problems might as easy have to do with the original author and his experience in writing such an application (and hence choice of PHP for this task). But this post also springs to mind: https://software-gunslinger.tumblr.com/post/47131406821/php-is-meant-to-die https://software-gunslinger.tumblr.com/post/47131406821/php-...