开发者

Does PHP5 support multi threading? [duplicate]

开发者 https://www.devze.com 2023-01-03 14:26 出处:网络
This question a开发者_运维技巧lready has answers here: Closed 12 years ago. Possible Duplicate: How can one use multi threading in php applications
This question a开发者_运维技巧lready has answers here: Closed 12 years ago.

Possible Duplicate:

How can one use multi threading in php applications

Does anybody know whether or not PHP5 supports multi threading? If it does, how to implement that?


When using php as a module (like in apache), it's not possible. If you use php in CLI, you can use the function pcntl_fork


While you can use the pcntl extension to fork, please don't. It creates all sorts of entertaining issues, especially when you're using mod_php.

There are better ways. Try a work queue, like Gearman.

0

精彩评论

暂无评论...
验证码 换一张
取 消