pthreads
PHP Manual

The Threaded class

(PECL pthreads >= 2.0.0)

Introduction

Threaded objects form the basis of pthreads ability to execute user code in parallel; they expose synchronization methods and various useful interfaces.

Threaded objects, most importantly, provide implicit safety for the programmer; all operations on the object scope are safe.

Class synopsis

Threaded implements Collectable , Traversable , Countable , ArrayAccess {
/* Methods */
public array chunk ( int $size , bool $preserve )
public int count ( void )
public bool extend ( string $class )
public Threaded from ( Closure $run [, Closure $construct [, array $args ]] )
public array getTerminationInfo ( void )
public bool isRunning ( void )
public bool isTerminated ( void )
public bool isWaiting ( void )
public bool lock ( void )
public bool merge ( mixed $from [, bool $overwrite ] )
public bool notify ( void )
public bool notifyOne ( void )
public bool pop ( void )
public void run ( void )
public mixed shift ( void )
public mixed synchronized ( Closure $block [, mixed $... ] )
public bool unlock ( void )
public bool wait ([ int $timeout ] )
}

Table of Contents


pthreads
PHP Manual