Is it possible to use shared memory for communication between php scripts and program c in windows?
Program c runs all the time and uses memory-mapped files, i.e.:
handle1 = CreateFileMapping(
(HANDLE)0xFFFFFFFF, NULL, PAGE_READWRITE, 0, sizeof(byte)*BUFFER_SIZE, "my_foo" );
hView = (LPINT) MapViewOfFile(handle1, FILE_MAP_ALL_ACCESS, 0, 0, 0);
For PHP scripts, I can simply use the code below to open the memory mapping file created by c?
$shmkey = @shmop_open(ftok("my_foo", 'R'), "a", 0644, $buffer_size);
or are there c files with memory mapping and php shared memory different things?
source
share