yes i know that php do not support multithreading but i tried to work around this problem by making multiprocess with shared object (using stream_socket_pair ) .
1- the master(mp) process is the parent for all forked process (p1,p2,p3,p4,p5,p6...... etc)
2- if p1 want to communicate with p2 it should leave a message for p2 at the master process . (ie: the master process will act as the container which all processess read and write from it ),
the communication between the processes is indirect (it will be via the master process). but the master process sometime returned invalid data (may be because the load on the server).
finally i decided to use java for the backend not php