« Swoole\Atomic::cmpset
Swoole\Atomic::get »

Swoole\Atomic::__construct

(PECL swoole >= 1.9.0)

Swoole\Atomic::__construct — Construct a swoole atomic object.

説明

public function Swoole\Atomic::__construct(int $value = ?)

Swoole atomic object is an integer variable allows any processor to atomically test and modify. It is implemented based on CPU atomic instructions. The Swoole atomic variables have to defined before swoole_server->start.

Compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization. It compares the content of a memory location with a given value and, only if they are the same, modifies the content of that memory location to a new given value.

パラメータ

value

The value of the atomic object.

関連キーワード:
atomic   Swoole   Atomic   swoole   Construct   construct   content   memory   location   cmpset   integer   variable   processor   atomically   instructions   defined   server   swap   instruction   multithreading   synchronization   modifies
関連する関数・ページ:
swoole-atomic.set   swoole-atomic.get   swoole-atomic.cmpset   swoole-atomic.add   class.swoole-atomic   swoole-atomic.sub

他のマニュアルの関連ページ