SyncSharedMemory
class SyncSharedMemory (View source)
SyncSharedMemory
A cross-platform, native, consistent implementation of named shared memory objects. Shared memory lets two separate processes communicate without the need for complex pipes or sockets. There are several integer-based shared memory implementations for PHP. Named shared memory is an alternative. Synchronization objects (e.g. SyncMutex) are still required to protect most uses of shared memory.
Methods
Constructs a new SyncSharedMemory object
Check to see if the object is the first instance system-wide of named shared memory
Copy data from named shared memory
Returns the size of the named shared memory
Copy data to named shared memory
Details
__construct(string $name, int $size)
Constructs a new SyncSharedMemory object
Constructs a named shared memory object.
bool
first()
Check to see if the object is the first instance system-wide of named shared memory
Retrieves the system-wide first instance status of a SyncSharedMemory object.
string
read(int $start = 0, int $length)
Copy data from named shared memory
Copies data from named shared memory.
int
size()
Returns the size of the named shared memory
Retrieves the shared memory size of a SyncSharedMemory object.
int
write(string $string, int $start = 0)
Copy data to named shared memory
Copies data to named shared memory.