The Threaded class

(PECL pthreads >= 2.0.0)

Введение

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.

Обзор классов

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

Содержание

Коментарии

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

However, this comes with a trade-off: Operations on the instance scope are slower than on plain PHP objects.

Static properties are not affected as they are thread-local.
2015-07-12 10:50:35
http://php5.kiev.ua/manual/ru/class.threaded.html
It's worth mentioning here that, since v2.0.0, 'Stackable' class was an alias for 'Threaded' class but has been removed since.
2019-06-24 09:43:50
http://php5.kiev.ua/manual/ru/class.threaded.html

    Поддержать сайт на родительском проекте КГБ