threading introduction threading is one of the ways in which python allows you to write programs that multitaskthat is appearing to do more than one thing at time this presents the threading module and uses short example to illustrate how these features can be used threads in python the thread class from the threading module represents an activity that is run in separate thread of execution within single process these threads of execution are lightweightpre-emptive execution threads thread is lightweight because it does not possess its own address space and it is not treated as separate entity by the host operating systemit is not process insteadit exists within single machine process using the same address space as other threads thread states when thread object is first created it existsbut it is not yet runnableit must be started once it has been started it is then runnablethat isit is eligible to be scheduled for execution it may switch back and forth between running and being runnable under the control of the scheduler the scheduler is responsible for managing multiple threads that all wish to grab some execution time thread object remains runnable or running until its run(method terminatesat which point it has finished its execution and it is now dead all states between (cspringer nature switzerland ag huntadvanced guide to python programmingundergraduate topics in computer science