S
S
Sergey2015-05-18 11:19:41
linux
Sergey, 2015-05-18 11:19:41

How to implement shared memory between php and something?

Good afternoon. Is there any comprehensive article or book on implementing shared memory in C++ or Python. With PHP, everything is clear and very simple, between PHP processes the use of a reserved segment is easy and effortless, but with C ++ everything turned out to be more complicated. I won't give the exact C++ code because it's on a different machine, but in short I used shm_open to get access and mmap to read from it. Something like this here: https://gist.github.com/kashyapp/4385922,got a memory segmentation fault. Actually, I would like to get a kick to the link with an example of the interaction between PHP and C ++ using shared memory, or to see a piece of code that would show the simplest implementation of this interaction (for example, php writes hello, world, c ++ reads and outputs to the console). And another question: why is the id of a segment in php a number, but in c++ it is the path to the file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Murfy, 2019-07-19
@qxcoder

Create your own PHP extension.
https://habr.com/ru/post/98862/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question