How can shared memory be locked in php (shmop) -


please how can shared memory created in php using shmop (not shm if matters) locked , unlocked? require libraries?

it seems shmop_read() runs while shmop_write() still writing because value read has part of old , new values.

you cannot explicity lock shared memory segment, can open in exclusive mode, e.g.

shmop_open($shm_key, "n", 0644, 100); 

quoting http://www.php.net/manual/en/function.shmop-open.php

"n" create new memory segment (sets ipc_create|ipc_excl) use flag when want create new shared memory segment if 1 exists same flag, fail. useful security purposes, using can prevent race condition exploits.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -