Should Do I Use Pcntl For Multi-Process?

In my project, i have many things that need to use multi-process, for example sending email when user create an account etc. I known that there are many ways to solve this issue such as ajax, curl and special PCNTL. I am using an unix server, so its very able to use PCNTL. However, i dont known PCNTL is good at multi-process or not. So i hope that someone can tell me that using PCNTL is good?. Thanks so much:d

I think you should use any kind of queue. There are some nice solutions for PHP to add tasks to queue and to implement workers that will perform them.

BTW mail has a built-in queue, that is you could have a local mail transport that would queue up the messages to send to avoid expensive communication with a remote server.

pcntl is somewhat experimental and doesn’t behave well in a lot of environments. Besides, you don’t really want to send out mails in parallel. Queues are much more suitable for this task.

Sending email is just one example that i need use multiprocess. And I also choose using queque to send out email. BTW, thanks you so much. :lol: