Using shared memory with php and c?

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?

+3
source share
2 answers

PHP shmop functions are just shells for the underlying POSIX functions that seem to be not available in windows.

From the PHP manual :

. Windows, Windows 2000, . Windows, Shmop , PHP - , Apache IIS (CLI CGI ).

-, PHP apache, , .

+3

PHP , Windows. , php (php_gsect.dll). , , php_gsect ( ) , .

FYI: Windows . - php ( ESJ).

0

Source: https://habr.com/ru/post/1705319/


All Articles