The Concurrency Kit is a .NET/Mono kit that includes a port of the Task Parallel Library and extends it to support Fibers, Coroutines, and Unity. Fibers allow code paths to execute concurrently using a single thread by leveraging the co-operative yielding behavior of coroutines.
Because code written in this manner is designed with concurrency in mind, tasks can run in parallel across multiple threads or as concurrent fibers on a single thread just by changing out the task scheduler. This flexibility makes it easy to write and maintain asynchronous code that scales.
The Concurrency Kit consists of four modular packages.
Using Asynchronous Tasks
For a full explanation of the Task programming model, please see the Task Parallel Library documentation on MSDN.
Fiber support is provided by the SpicyPixel.Threading.dll assembly and it includes packages for both the core fiber features as well as an asynchronous task model for fibers.
Using Fibers in Unity
Unity specific fiber support is provided by the SpicyPixel.Threading.Unity.dll assembly and it includes a UnityFiberScheduler that can schedule work as a Unity coroutine using either the core fiber model or the task model.
The package also extends MonoBehaviour to support convenience methods for working with fibers and tasks. See Unity Integration.
- Integrate latest Mono version
- AOT fixes
- Rename scheduler 'SharedInstance' singletons to 'Default' for consistency with TPL
- Support iOS by working around AOT compiler limitations
- Add the following convenience types and members:
- class UnitySynchronizationContext
- class UnityTaskFactory
- class UnityTaskScheduler
- property UnityFiberScheduler.SharedInstance
- property ConcurrentBehaviour.SharedInstance
- Add Unity sample ConcurrencyKitSample
- Initial release