{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/17"}],"enrichment":{"capability":"KThread provides a way to forcefully terminate running threads by raising a SystemExit exception within them, extending Python's standard threading.Thread class with kill(), terminate(), and exit() methods.","skillfed_tags":["threading","legacy-maintenance-risk"],"use_cases":["Stopping long-running worker threads when a parent process receives a shutdown signal","Cleaning up threads that enter infinite loops and cannot be interrupted by normal means","Testing code that spawns threads, where you need to forcibly halt them between test cases","Implementing timeout mechanisms for thread-based operations when standard timeout patterns are unavailable"],"what_it_does":"KThread is a thin wrapper around Python's threading.Thread that adds methods to forcefully terminate a running thread by injecting a SystemExit exception via the CPython API. It solves the problem that the standard library offers no built-in way to stop a thread once started\u2014you can only wait for it to finish naturally.\n\nThe package works by leveraging low-level CPython internals to raise an exception inside a target thread. Threads blocked on OS calls (like time.sleep, socket.accept, or socket.recv) will not respond to termination. The author includes a strong disclaimer that thread termination can introduce instability, resource leaks, or other undesirable effects, and provides no warranty. It is intended for cases where you have no other way to stop a thread and accept the risks.","worth_installing":"No. The package is abandoned (last update 2022-02-19) and comes with explicit warnings that thread termination can cause instability. Modern Python code should use threading.Event, queue.Queue, or async/await for controlled thread shutdown. Install only if you have a specific legacy codebase already using it and cannot refactor to safer patterns."},"id":"kthread","links":{"html":"https://skillfed.io/packages/kthread","md":"https://skillfed.io/packages/kthread.md","pypi":"https://pypi.org/project/kthread/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2022-02-19","license_spdx":null,"license_treatment":"permissive","name":"kthread","python_support":"unspecified","summary":"Killable threads in Python!"},"popularity":{"monthly_downloads":89985,"position":13626,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.3"}
