A parallel-processing and multi-processing library for Object Pascal with lock-free data structures and synchronization primitives.
PasMP is a comprehensive parallel processing library for Object Pascal that enables efficient multi-threading and parallel computing. It provides both low-level primitives and high-level constructs, such as a lock-free work-stealing job scheduler and parallel algorithms, to build scalable applications. The library is designed to reduce error-proneness through a fully-strict fork-join model while offering flexibility for performance-critical software like game engines.
Object Pascal developers, particularly those using FreePascal (≥3.0.0) or Delphi (≥7), who are building performance-intensive applications such as game engines, simulation software, or data processing tools that require efficient multi-threading. It targets developers needing cross-platform compatibility on Windows (Vista+), Linux, and other systems.
Developers choose PasMP for its emphasis on lock-free designs, like its dynamic-sized Chase-Lev work-stealing queue and job memory allocator, which minimize contention and enhance performance. It stands out by offering a comprehensive set of thread-safe data structures and synchronization primitives, combined with a focus on the less error-prone fully-strict fork-join model, making it a robust solution for parallel computing in Object Pascal.
PasMP - a parallel-processing/multi-processing library for Object Pascal
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements a dynamic-sized Chase-Lev deque for efficient job scheduling with minimal contention, lock-free on x86 and ARM targets, enhancing performance in parallel scenarios.
Includes parallel-for, intro sort, and merge sort patterns, enabling scalable data processing for performance-critical applications like game engines or simulations.
Offers a wide range of structures such as queues, stacks, and hash tables with lock-free or fine-grained locking implementations, reducing synchronization overhead in multi-threaded code.
Supports FreePascal ≥3.0.0 and Delphi ≥7 on Windows Vista+, Linux, and other platforms, making it versatile for legacy and modern Object Pascal projects.
Provides a lock-free job memory allocator for x86-32 and x86-64 targets, optimizing memory management in parallel applications with minimal contention.
Lock-free implementations are only available for x86 and ARM; MIPS and PowerPC targets are restricted to lock-based variants, potentially impacting performance on those architectures.
Requires developers to explicitly release jobs using TPasMP.Reset or flags like PasMPJobFlagReleaseOnFinish to prevent memory leaks, adding complexity and error-proneness.
While designed for a fully-strict fork-join model, using more flexible concurrency models requires careful handling and can lead to errors if not managed correctly, as noted in the README.
Relies on specific instructions like cmpxchg8b or ldrexd, which may not be available on all processors, limiting compatibility with older or niche hardware without fallbacks.