Using Threads
Learn to use threads.
We'll cover the following...
What are threads?
Threads in Python are a good way to run a function concurrently with other functions. If your system does not support multiple processors, the threads will be executed one after another as scheduled by the operating system. However, if multiple CPUs are available, threads could be scheduled on multiple processing units, once again as determined by the operating system.
By default, there is only one thread, the main thread, and it is the thread that runs your Python application. To start another thread, Python provides the threading module.
To run the following code snippet, press the Run button and enter the command
python2 threading-start.py
. ...