A PowerShell module for running concurrent jobs using threads instead of processes, reducing resource overhead.
PSThreadJob is a PowerShell module that extends PowerShell's built-in job infrastructure to support thread-based concurrent jobs. It provides a lighter-weight alternative to process-based BackgroundJob jobs, enabling faster execution and reduced system resource consumption while maintaining compatibility with existing PowerShell job cmdlets.
PowerShell developers and system administrators who need to run concurrent scripts efficiently, especially those managing hundreds of jobs or working in resource-constrained environments.
Developers choose PSThreadJob over built-in BackgroundJob jobs for its significantly lower overhead, faster performance due to thread-based execution, and built-in throttling to manage concurrent jobs, all while seamlessly integrating with existing PowerShell job cmdlets.
A PowerShell module for running concurrent jobs based on threads rather than processes
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Jobs execute quicker due to lower overhead and avoiding the remoting serialization system used by BackgroundJob jobs, with examples showing up to 8 times faster creation times.
Significantly lowers system resource usage by running jobs in threads within the local process, making it ideal for handling hundreds of concurrent jobs without process bloat.
Supports a ThrottleLimit parameter to automatically queue excess jobs, a feature missing in built-in BackgroundJob jobs, enabling better concurrency management.
Works with existing PowerShell job cmdlets like Get-Job and Receive-Job, allowing adoption with minimal changes to existing scripts and workflows.
Returned objects are 'live' and not re-hydrated from serialization, enabling direct manipulation, though caution is needed to avoid unintended side effects.
Thread-based jobs share the same process; if one job crashes, it can terminate all concurrent ThreadJob jobs, unlike process-based BackgroundJob jobs that offer better isolation.
Requires separate installation from the PowerShell Gallery, adding an external dependency that built-in BackgroundJob jobs do not have, which can complicate deployment in locked-down environments.
Scripts must handle concurrent access to shared resources carefully, as threads run in the same memory space, increasing the risk of race conditions if not properly managed.