{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/3"},{"label":"Scientific/Engineering","url":"https://skillfed.io/packages/category/scientific-engineering/2"},{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/3"}],"enrichment":{"capability":"Loky provides a reusable ProcessPoolExecutor that handles parallel task execution across multiple worker processes with safer spawning behavior and transparent support for non-picklable functions.","skillfed_tags":["multiprocessing","parallelization","concurrent-execution"],"use_cases":["Running CPU-bound tasks in parallel across multiple cores without fork-only multiprocessing hazards.","Submitting lambda functions and locally defined functions to worker processes in interactive environments.","Maintaining a persistent pool of workers across multiple independent parallel workloads to reduce spawn overhead.","Executing tasks on macOS or with OpenMP-linked libraries where standard multiprocessing.Pool causes crashes.","Batch processing workflows that need automatic worker cleanup after periods of inactivity."],"what_it_does":"Loky is a robust implementation of Python's ProcessPoolExecutor that addresses known limitations in the standard library's multiprocessing and concurrent.futures modules. It uses fork + exec on POSIX systems instead of fork alone, which prevents crashes when third-party libraries (like OpenMP or macOS Accelerate) are involved. The package integrates cloudpickle transparently, allowing you to submit interactively defined functions and lambdas to worker processes without the typical pickling constraints.\n\nThe core feature is the reusable executor pattern: instead of spawning and tearing down a new executor for each batch of tasks, you can maintain a singleton instance that persists across calls, with optional automatic worker shutdown after idle timeouts. This avoids repeated spawning overhead. Loky also eliminates the need for `if __name__ == \"__main__\":` guards on Windows by leveraging cloudpickle to serialize functions from the `__main__` module, and it implements deadlock-free handling of worker process crashes with meaningful error reporting.","worth_installing":"Yes. Loky is actively maintained, has no known vulnerabilities, and solves real problems in the standard library's process pool implementation\u2014particularly safer spawning behavior and reusability. The single dependency (cloudpickle) is lightweight. Install it if you need robust parallel task execution, especially on macOS or with third-party C libraries, or if you want to avoid repeated executor spawn overhead."},"id":"loky","links":{"html":"https://skillfed.io/packages/loky","md":"https://skillfed.io/packages/loky.md","pypi":"https://pypi.org/project/loky/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-08-27","license_spdx":null,"license_treatment":"permissive","name":"loky","python_support":"supports_current","summary":"A robust implementation of concurrent.futures.ProcessPoolExecutor"},"popularity":{"monthly_downloads":1977414,"position":3391,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.5.6"}
