How to IPC between PHP clients and a C Daemon Server?

后端 未结 7 1099
春和景丽
春和景丽 2020-12-02 13:32

and thanks for taking a look at the question.

The background
I have several machines that continuously spawn multiple (up to 300) PHP console sc

7条回答
  •  感动是毒
    2020-12-02 14:04

    You could also load the data structure into shared memory using PHP's shared memory functions http://www.php.net/manual/en/book.shmop.php.

    Oh, it's not obvious from the documentation but the coordinating variable is $key in shmop_open. Every process needing access to the shared memory should have the same $key. So, one process creates the shared memory with $key. The other processes then can access that shared memory if they use the same $key. I believe you can choose whatever you like for $key.

提交回复
热议问题