Ruri
March 9, 2021, 1:28am
1
As I mentioned in the past, I wrote a new threading system from scratch.
It’s fully async, has unit tests and everything. I uploaded it to nuget so you can use it in your own projects as well.
You can find some sample code here
# RuriLib.Parallelization
This is a library that can perform multiple tasks (yes, a lot, even infinitely many) that act on some input and return a certain output.
Features:
- Fully asynchronous
- Dynamic degree of parallelism (change it while it runs)
- Pausing and resuming
- Soft stop and hard abort
- Automatic CPM calculation
- Events
# Installation
[NuGet](https://nuget.org/packages/RuriLib.Parallelization): `dotnet add package RuriLib.Parallelization`
# Example
```csharp
using RuriLib.Parallelization;
using RuriLib.Parallelization.Models;
using System;
using System.Linq;
This file has been truncated. show original
Ruri
5 Likes
Ruri
June 7, 2026, 1:14pm
2
The library has been updated. Here’s the changes
Changelog
2.0.0 - 2026-06-06
Changes since 1.0.6, released on 2022-03-09:
Retargeted the package to .NET 10.
Added cancellation token support to parallelizer control methods.
Reworked TaskBasedParallelizer for more reliable scheduling and completion handling.
Improved CPM calculation and CPM limiting behavior.
Fixed degree-of-parallelism edge cases, including operation with DoP set to 1.
Reduced CPU spinning while waiting under CPM limits.
Fixed timing-sensitive stop, abort, start, reset, and completion state transitions.
Marked ThreadBasedParallelizer as obsolete.
Added and refactored regression tests for task-based, thread-based, and parallel-based parallelizers.
1 Like