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

classThreadedimplementsCollectable, Traversable, Countable, ArrayAccess {
publicchunk(int$size, bool$preserve): array
publiccount(): int
publicextend(string$class): bool
publicisRunning(): bool
publicmerge(mixed$from, bool$overwrite = ?): bool
publicnotify(): bool
publicnotifyOne(): bool
publicpop(): bool
publicrun(): void
publicshift(): mixed
publicsynchronized(Closure$block, mixed...$args): mixed
publicwait(int$timeout = ?): bool
}

Table of Contents

To Top