문제

I am playing with pcntl_fork() in PHP.

I took the class that is written in the second comment, and tried to send data to it - which seems to work fine.

Now I did some processing on that data, and would like to receive some results in my parent process.

Does anyone know how this can be done ? The only way I can think of doing this is to store the information in the database and/or other storage.

도움이 되었습니까?

해결책

Having worked with pcntl fork in a number of projects i do not believe there is any way to send data back to the parent process directly. You would be able to do this via the database as you have already mentioned however you may be better off using PHP's shared memory components (http://php.net/manual/en/book.shmop.php) or memcache for this purpose.

Can you elaborate on what you are doing, it may be that you can avoid this requirement.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top