Can I create threads in PHP?

Possible duplicate:
Does PHP have streaming?

I found this: http://php.net/manual/en/function.pcntl-fork.php

But I can’t say if these flows or processes are confused. They use both words.

If you have an alternative solution, you need threads for this: I want to create a game in real time using web sockets, and I thought that in the background there is one process that generates one thread for each game (or room ) on request.

+3
source share
3 answers

This is just a wrapper for the C fork () function. It creates processes, not threads. PHP does not support multithreading.

+2

pcntl_fork . "" , "" :

pcntl_fork() , PID PPID.

PHP ( , - ).

, - , . .

+3

* PHP does not support multithreading.

0
source