Python Multithreading
Python Multithreading
Threading Modules
Methods Description
start() A start() method is used to initiate the activity of a thread. And it calls only once for each thread so that the execution of the thread
run() A run() method is used to define a thread's activity and can be overridden by a class that extends the threads class.
join() A join() method is used to block the execution of another code until the thread terminates .
Syntax:
1. import threading
Syntax:
1. t1.start()
2. t2.start()
4. Join method: It is a join() method used in the thread class to halt the main thread's execution
and waits till the complete execution of the thread object. When the thread object is completed,
it starts the execution of the main thread in Python.