Concurrent, Asynchronous, Distributed, Communicating Tasks with Python
pycos is a Python framework for asynchronous, concurrent, distributed programming with tasks, asynchronous completions and message passing.
pycos can be used to create tasks with generator functions, similar to the way threads are created with functions with Python’s threading module. Programs developed with pycos have same logic and structure as programs with threads, except for a few syntactic changes - mostly using yield with asynchronous completions that give control to pycos’s scheduler, which interleaves executions of generators, similar to the way an operating system executes multiple processes.
Unlike threads, creating processes (tasks) with pycos is very efficient. Moreover, with pycos context switch occurs only when tasks use yield (typically with an asychronous call), so there is no need for locking and there is no overhead of unnecessary context switches.
pycos works with Python versions 2.7+ and 3.1+. It has been tested with Linux, Mac OS X and Windows; it may work on other platforms, too.
- No callbacks or event loops! No need to lock critical sections either,
- Efficient polling mechanisms epoll, kqueue, /dev/poll, Windows I/O Completion Ports (IOCP) for high performance and scalability,
- Asynchronous (non-blocking) sockets and pipes, for concurrent processing of I/O,
- SSL for security,
- Asynchronous locking primitives similar to Python threading module,
- Asynchronous timers and timeouts,
- Message passing for (local and remote) tasks to exchange messages one-to-one with Message Queue Pattern or through broadcasting channels with Publish-Subscribe Pattern,
- Location transparency with naming and locating (local and remote) resources,
- Monitoring and restarting of (local or remote) tasks, for fault detection and fault-tolerance,
- Distributing computation components (code and data) for execution of distributed communicating processes, for wide range of use cases, covering SIMD, MISD, MIMD system architectures at the process level, and web interface to monitor cluster/application status/performance; in-memory processing, data streaming, real-time (live) analytics and cloud computing are supported as well,
- Remote execution of tasks for distributed programming with Remote Task Invocation (RTI) and message passing,
- Hot-swapping of task functions, for dynamic system reconfiguration,
- Thread pools with asynchronous task completions, for executing synchronous tasks, e.g., external library calls, such as reading standard input.
pycos is implemented with standard modules in Python.
If psutil is available on nodes, node availability status (CPU, memory and disk) is sent in status messages, and shown in web browser so node/application performance can be monitored.
Under Windows efficient polling notifier I/O Completion Ports (IOCP) is supported only if pywin32 is available; otherwise, inefficient select notifier is used.
To install pycos, run:
python -m pip install pycos
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pycos-4.8.13.tar.gz (446.0 kB)||File type Source||Python version None||Upload date||Hashes View hashes|