Net4x.SmartThreadPool
1.5.0.7
dotnet add package Net4x.SmartThreadPool --version 1.5.0.7
NuGet\Install-Package Net4x.SmartThreadPool -Version 1.5.0.7
<PackageReference Include="Net4x.SmartThreadPool" Version="1.5.0.7" />
<PackageVersion Include="Net4x.SmartThreadPool" Version="1.5.0.7" />
<PackageReference Include="Net4x.SmartThreadPool" />
paket add Net4x.SmartThreadPool --version 1.5.0.7
#r "nuget: Net4x.SmartThreadPool, 1.5.0.7"
#:package Net4x.SmartThreadPool@1.5.0.7
#addin nuget:?package=Net4x.SmartThreadPool&version=1.5.0.7
#tool nuget:?package=Net4x.SmartThreadPool&version=1.5.0.7
Net4x.SmartThreadPool
Net4x.SmartThreadPool is a lightweight, cross-targeted thread pool implementation and utilities intended for desktop and server scenarios where you need more control than the CLR thread-pool provides or where you must support older .NET frameworks.
Authors: Piero Viano
Purpose
This project provides a flexible thread-pool abstraction with helpers for queuing work items, scheduling delayed or periodic tasks, and controlling worker thread behavior across many target frameworks (including legacy .NET Framework versions). It is useful when you need deterministic task scheduling, custom throttling, or compatibility with older runtimes that don't expose newer concurrency primitives.
Key features
- Queue and execute work items on a managed thread pool
- Support for delayed and periodic scheduling (timer-like helpers)
- Work item prioritization and cancellation support (where available)
- Lightweight APIs suitable for embedding in libraries that target multiple TFMs
- Builds for many TFMs including net20..net48, netstandard2.0, and modern net5+/net6+/net7+ configurations
Supported targets
The project includes builds that target a wide range of frameworks. Typical TFMs include:
- .NET Framework 2.0 through 4.8
- .NET Standard 2.0
- .NET 5, 6, 7, 8, 9 (and Windows-specific variations where applicable)
See the project file Net4x.SmartThreadPool.csproj for the exact TFMs produced by this project.
Quick start
Add a reference to the Net4x.SmartThreadPool project or the built assembly appropriate for your target framework, then queue work items or schedule timers.
Example (conceptual):
// Create or obtain a SmartThreadPool instance (factory or static API may exist)
using(var pool = new Net4x.SmartThreadPool.SmartThreadPool(maxWorkers: 4))
{
// Queue a short-running action
pool.QueueWorkItem(() => {
// do background work
});
// Queue work with a result and wait for completion
var handle = pool.QueueWorkItem(() => ComputeResult());
var result = handle.WaitForResult();
// Schedule a periodic task
var timer = pool.SchedulePeriodic(TimeSpan.FromSeconds(1), () => {
// periodic work
});
// Cancel a queued or running work item if supported
handle.Cancel();
}
Note: The public API surface may vary between TFMs. Check the source types under src/SmartThreadPool for exact type and member names.
Building
- For SDK-style configurations (netstandard/net5+): use
dotnet buildin thesrc/SmartThreadPoolproject directory. - For .NET Framework targets: open the containing solution in Visual Studio and build the specific project configuration.
Build only the TFMs you need � the repository contains many cross-targeted project configurations.
Tests
Unit tests for the SmartThreadPool are located in corresponding test projects under tests/. Use dotnet test for SDK-style projects or run tests from Visual Studio for .NET Framework test projects.
Contributing
Contributions and bug reports are welcome. Please:
- Open an issue describing the problem or feature request.
- Provide small, focused pull requests when possible.
- Add or update unit tests for any behavioral changes.
If you want the README to contain exact code samples using the project's real public types and members, I can extract those names from the code and update the examples accordingly.
License
See the repository LICENSE.txt for licensing details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net20 is compatible. net30 is compatible. net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 2.0
- Net4x.AsyncBridge (>= 1.5.0.7)
-
.NETFramework 3.0
- Net4x.AsyncBridge (>= 1.5.0.7)
-
.NETFramework 3.5
- Net4x.AsyncBridge (>= 1.5.0.7)
-
.NETFramework 4.0
- Net4x.AsyncBridge (>= 1.5.0.7)
-
.NETFramework 4.5
- Net4x.AsyncBridge (>= 1.5.0.7)
-
.NETFramework 4.6.1
- Net4x.AsyncBridge (>= 1.5.0.7)
-
.NETStandard 2.0
- Net4x.AsyncBridge (>= 1.5.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.0.7 | 63 | 12/30/2025 |
| 1.5.0.6 | 133 | 12/26/2025 |
| 1.5.0.5 | 108 | 12/21/2025 |
| 1.5.0.2 | 284 | 11/13/2025 |
| 1.5.0.1 | 207 | 11/9/2025 |
| 1.5.0 | 251 | 4/4/2025 |
| 1.1.0 | 291 | 8/27/2023 |
| 1.1.0-at20230430053600 | 259 | 5/8/2023 |
| 1.0.0-at20230416032846 | 231 | 4/16/2023 |
| 1.0.0-at20230411061314 | 16,046 | 4/14/2023 |
| 1.0.0-at20230409094012 | 220 | 4/9/2023 |
| 1.0.0-at20230409084002 | 239 | 4/9/2023 |
| 1.0.0-at20230409075105 | 238 | 4/9/2023 |
| 1.0.0-at20230409072402 | 220 | 4/9/2023 |
| 1.0.0-at20230408 | 229 | 4/8/2023 |