首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SyncSharedMemory (class)

Introduction

(PECL sync >= 1.1.0)

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.

Class synopsis

SyncSharedMemory {

/* Methods */

代码语言:javascript
复制
public __construct ( string $name , integer $size )
代码语言:javascript
复制
public bool first ( void )
代码语言:javascript
复制
public read ([ integer $start = 0 [, integer $length ]] )
代码语言:javascript
复制
public bool size ( void )
代码语言:javascript
复制
public write ([ string $string [, integer $start = 0 ]] )

}

Table of Contents

  • SyncSharedMemory::__construct — Constructs a new SyncSharedMemory object
  • SyncSharedMemory::first — Check to see if the object is the first instance system-wide of named shared memory
  • SyncSharedMemory::size — Returns the size of the named shared memory
  • SyncSharedMemory::write — Copy data to named shared memory

← SyncReaderWriter::writeunlock

SyncSharedMemory::__construct →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com