PHPackages                             aza/thread - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. aza/thread

ActiveLibrary[Queues &amp; Workers](/categories/queues)

aza/thread
==========

AzaThread - Anizoptera CMF simple and powerful threads emulation component for PHP (based on forks).

v1.1(12y ago)7128.7k4[3 issues](https://github.com/Anizoptera/AzaThread/issues)2MITPHPPHP &gt;=5.3.3

Since Feb 27Pushed 12y ago7 watchersCompare

[ Source](https://github.com/Anizoptera/AzaThread)[ Packagist](https://packagist.org/packages/aza/thread)[ Docs](https://github.com/Anizoptera/AzaThread)[ RSS](/packages/aza-thread/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (2)

AzaThread
=========

[](#azathread)

Simple and powerful threads emulation component for PHP (based on forks). Old name - CThread.

[![Build Status](https://camo.githubusercontent.com/6aaf2c0fab39050c96e7c1759d467dcba0b19e742c57e11f1cfbdb58d88086e2/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f416e697a6f70746572612f417a615468726561642e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/Anizoptera/AzaThread)

Table of Contents
-----------------

[](#table-of-contents)

1. [Introduction](#introduction)
2. [Requirements](#requirements)
3. [Installation](#installation)
4. [Documentation and examples](#documentation-and-examples)
5. [Tests](#tests)
6. [Credits](#credits)
7. [License](#license)
8. [Links](#links)

Introduction
------------

[](#introduction)

**Features:**

- Uses [forks](http://php.net/pcntl-fork) to operate asynchronously;
- Supports synchronous compatibility mode if there are no required extensions;
- Reuse of the child processes;
- Full exchange of data between processes. Sending arguments, receiving results;
- Transfer of events between the "thread" and the parent process;
- Working with a thread pool with preservation of multiple use, passing arguments and receiving results;
- Uses [libevent](http://php.net/libevent) with socket pairs for efficient inter-process communication;
- Supports two variants of data serialization for transfer (igbinary, native php serialization);
- Errors handling;
- Timeouts for work, child process waiting, initialization;
- Maximum performance and customization;

Requirements
------------

[](#requirements)

- PHP 5.3.3 (or later);
- Unix system;
- [libevent](http://php.net/libevent);
- [pcntl](http://php.net/pcntl);
- [posix](http://php.net/posix);
- [AzaLibevent](https://github.com/Anizoptera/AzaLibEvent) - will be installed automatically with composer;
- [AzaSocket](https://github.com/Anizoptera/AzaSocket) - will be installed automatically with composer;
- [AzaCliBase](https://github.com/Anizoptera/AzaCliBase) - will be installed automatically with composer;

NOTE: You can use synchronous compatibility mode even without requirements (or on windows, for example).

Installation
------------

[](#installation)

The recommended way to install AzaThread is [through composer](http://getcomposer.org). You can see [package information on Packagist](https://packagist.org/packages/aza/thread).

```
{
	"require": {
		"aza/thread": "~1.0"
	}
}
```

Documentation and examples
--------------------------

[](#documentation-and-examples)

See [full documentation](docs/en/0.Index.md) and [main examples](docs/en/Examples.md). Documentation is available in several languages​​!

Other examples can be seen in the file [examples/example.php](examples/example.php) and in unit test [Tests/ThreadTest.php](Tests/ThreadTest.php).

You can also run the performance tests, choose the number of threads and pick the best settings for your system configuration by using [examples/speed\_test.php](examples/speed_test.php).

Tests
-----

[](#tests)

Tests are in the `Tests` folder. To run them, you need PHPUnit. Example:

```
$ phpunit --configuration phpunit.xml.dist

```

Credits
-------

[](#credits)

AzaThread is a part of [Anizoptera CMF](https://github.com/Anizoptera), written by [Amal Samally](http://azagroup.ru/about/#amal) (amal.samally at gmail.com) and [AzaGroup](http://azagroup.ru/) team.

License
-------

[](#license)

Released under the [MIT](LICENSE.md) license.

Links
-----

[](#links)

- [Mail list](mailto:azathread@googlegroups.com) (via [Google Group](https://groups.google.com/forum/#!forum/azathread))
- [Composer package](https://packagist.org/packages/aza/thread)
- [Last build on the Travis CI](http://travis-ci.org/Anizoptera/AzaThread)
- [Project profile on the Ohloh](https://www.ohloh.net/p/AzaThread)
- (RU) [AzaThread — многопоточность для PHP с блэкджеком](http://habrahabr.ru/blogs/php/134501/)
- Other Anizoptera CMF components on the [GitHub](https://github.com/Anizoptera) / [Packagist](https://packagist.org/packages/aza)
- (RU) [AzaGroup team blog](http://azagroup.ru/)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Total

2

Last Release

4739d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/356b06126f37416ba259cc00868ae0960bad500f459186a25a7cc3b90c80fcb5?d=identicon)[amal](/maintainers/amal)

---

Top Contributors

[![art-shen](https://avatars.githubusercontent.com/u/423417?v=4)](https://github.com/art-shen "art-shen (52 commits)")[![bladeofsteel](https://avatars.githubusercontent.com/u/296507?v=4)](https://github.com/bladeofsteel "bladeofsteel (1 commits)")[![Erkan-Yilmaz](https://avatars.githubusercontent.com/u/642286?v=4)](https://github.com/Erkan-Yilmaz "Erkan-Yilmaz (1 commits)")[![mcuadros](https://avatars.githubusercontent.com/u/1573114?v=4)](https://github.com/mcuadros "mcuadros (1 commits)")

---

Tags

composerforkinter-process-communicationlibeventpackagistpcntlphpsocketsthreadthread-pooltravisasyncserializationparallelforkdaemonThreadMulti thread

### Embed Badge

![Health badge](/badges/aza-thread/health.svg)

```
[![Health](https://phpackages.com/badges/aza-thread/health.svg)](https://phpackages.com/packages/aza-thread)
```

###  Alternatives

[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13551.1M18](/packages/amphp-serialization)[recoil/recoil

Asynchronous coroutines for PHP 7.

78961.5k7](/packages/recoil-recoil)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

53541.0k3](/packages/jolicode-castor)[qxsch/worker-pool

Runs tasks in a parallel processing workerpool.

108325.7k1](/packages/qxsch-worker-pool)[recoil/react

Integrate Recoil with ReactPHP.

32274.4k12](/packages/recoil-react)[amphp/cluster

Building multi-core network applications with PHP.

6224.8k1](/packages/amphp-cluster)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
