(PECL sync >= 1.1.0)
SyncSharedMemory::__construct — Constructs a new SyncSharedMemory object
Constructs a named shared memory object.
The name of the shared memory object.
If the name already exists, it must be able to be opened by the current user that the process is running as or an exception will be thrown with a meaningless error message.
The size, in bytes, of shared memory to reserve.
The amount of memory cannot be resized later. Request sufficient storage up front.
The new SyncSharedMemory object. An exception is thrown if the shared memory object cannot be created or opened.
Beispiel #1 SyncSharedMemory::__construct() example
// You will probably need to protect shared memory with other synchronization objects.
// Shared memory goes away when the last reference to it disappears.
$mem = new SyncSharedMemory("AppReportName", 1024);
// Do first time initialization work here.
$result = $mem->write(json_encode(array("name" => "my_report.txt")));