0

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?

Community
  • 1
  • 1
DEVOPS
  • 18,190
  • 34
  • 95
  • 118
  • 1
    Similar: http://stackoverflow.com/questions/70855/how-can-one-use-multi-threading-in-php-applications – Babiker Jun 17 '10 at 04:56

2 Answers2

2

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

Ikke
  • 99,403
  • 23
  • 97
  • 120
0

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.

Charles
  • 50,943
  • 13
  • 104
  • 142