相关疑难解决方法(0)

How to choose the "Key" for inter-processes communication in Linux?

Good Day...

I am doing a homework which states that I have 5 processes; a server and the rest are clients. Each process is supposed to be sparked from a different executable. I am going to implement a two-way message passing solution, but the question is not about message passing per se. Is there an elegant way to communicate the key between those different executables. i.e. when I call the following function:

int msgget(key_t key, int msgflg);
Run Code Online (Sandbox Code Playgroud)

How are …

linux ipc message-passing

4
推荐指数
1
解决办法
3358
查看次数

php:删除Windows上的共享内存

这段代码:

shmop_delete();
shmop_close();
Run Code Online (Sandbox Code Playgroud)

不删除共享内存.一个实验:

$shmid = @shmop_open(1234, 'a', 0, 0);
var_dump($shmid);
Run Code Online (Sandbox Code Playgroud)

产量

bool(false)
Run Code Online (Sandbox Code Playgroud)

当然.但

$shmid = shmop_open(5678, 'c', 0644, 10);
...
shmop_delete($shmid);
shmop_close($shmid);
...
$shmid = @shmop_open(5678, 'a', 0, 0);
var_dump($shmid);
Run Code Online (Sandbox Code Playgroud)

产量

int(157)
Run Code Online (Sandbox Code Playgroud)

为什么不删除呢?如何删除共享内存?我在Windows 7上运行apache.

php shared-memory php-extension

4
推荐指数
1
解决办法
1816
查看次数

标签 统计

ipc ×1

linux ×1

message-passing ×1

php ×1

php-extension ×1

shared-memory ×1