Python threading Module Methods

Python threading Module has the following built-in functions.

Method Description
active_count() Returns the number of Thread objects that are active at any instant.
current_thread() Returns the current Thread object, which corresponds to the caller's thread of control.
enumerate() Returns the list of all the Thread class objects which are currently alive.
get_ident() Returns the "thread identifier" of the current thread.
get_native_id() Return the native Thread ID of the current thread which is assigned by the kernel.
main_thread() Return the main Thread object.
setprofile() Sets a profile method for all the threads that are created by the threading module. The func method is passed to sys.profile() for each method.
settrace() Sets a trace function for all the threads that are created by threading module. The func function is passed to sys.settrace() for each method.
stack_size() Return the thread stack size needed while creating new threads.

Reference:: https://docs.python.org/3/library/threading.html




Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.