1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 12:54:55 +01:00
Go to file
Aaron Piotrowski 6fad633e0d Fix task runner
2016-01-24 23:12:03 -06:00
bin Merge branch 'v1.x' 2016-01-23 11:29:22 -06:00
examples Allow run() to return anything 2016-01-24 23:04:29 -06:00
src Fix task runner 2016-01-24 23:12:03 -06:00
tests Allow run() to return anything 2016-01-24 23:04:29 -06:00
.gitattributes Remove old benchmark scripts 2015-12-13 17:42:24 -06:00
.gitignore Add vagrant to gitignore 2015-08-02 19:45:44 -05:00
.travis.yml Update travis build 2016-01-22 23:32:07 -06:00
.valgrindrc Add helpful defaults for Valgrind 2015-08-27 12:33:19 -05:00
CHANGELOG.md Update changelog 2016-01-15 13:07:12 -06:00
composer.json Add branch alias 2016-01-23 00:06:22 -06:00
CONTRIBUTING.md
LICENSE Update license 2015-09-14 21:28:25 -05:00
phpdoc.dist.xml
phpunit.xml.dist Merge back into one test suite 2015-08-05 11:29:22 -05:00
README.md docs cold turkey 2016-01-17 22:02:52 -06:00
Vagrantfile Update vagrant box for PHP 7 2016-01-23 10:50:56 -06:00

Concurrency for Icicle

True concurrency using native threading and multiprocessing for parallelizing code, without blocking.

This library is a component for Icicle that provides native threading, multiprocessing, process synchronization, shared memory, and task workers. Like other Icicle components, this library uses Coroutines built from Awaitables and Generators to make writing asynchronous code more like writing synchronous code.

Build Status Coverage Status Semantic Version MIT License @icicleio on Twitter

This library provides a means of parallelizing code without littering your application with complicated lock checking and inter-process communication.

To be as flexible as possible, this library comes with a collection of non-blocking concurrency tools that can be used independently as needed, as well as an "opinionated" worker API that allows you to assign units of work to a pool of worker threads or processes.

Requirements
  • PHP 5.5+
Suggested
  • pthreads extension: Best extension option for concurrency in PHP, but it requires PHP to be compiled with --enable-maintainer-zts to enable thread-safety.
  • pcntl extension: Enables forking concurrency method.
  • sysvmsg extension: Required for sharing memory between forks or processes.
Installation

The recommended way to install is with the Composer package manager. (See the Composer installation guide for information on installing and using Composer.)

Run the following command to use Icicle in your project:

composer require icicleio/concurrent

You can also manually edit composer.json to add this library as a project requirement.

// composer.json
{
    "require": {
        "icicleio/concurrent": "^0.3"
    }
}

Documentation

Documentation is available online at http://icicle.io/docs.

Development and Contributing

Interested in contributing to Icicle? Please see our contributing guidelines in the Icicle repository.

Want to hack on the source? A Vagrant box is provided with the repository to give a common development environment for running concurrent threads and processes, and comes with a bunch of handy tools and scripts for testing and experimentation.

Starting up and logging into the virtual machine is as simple as

vagrant up && vagrant ssh

Once inside the VM, you can install PHP extensions with Pickle, switch versions with newphp VERSION, and test for memory leaks with Valgrind.