Properties of Thread, Launching Ways, and Parameters Passing
Explore the properties of threads such as unique identifiers and names. Understand two primary ways to launch threads in Python, including subclassing the Thread class. Learn how to pass parameters to threads and how thread scheduling affects execution order.
We'll cover the following...
We'll cover the following...
Thread properties
Every running thread has a name and a number called a thread identifier associated with it.
The names of all running threads don’t need to be unique. However, the identifier must be unique. The identifier can be reused for other threads if the current thread ends.
In the code above, current_thread() is a function defined in the threading ...