Multithreading or threading is the solution to running ‘several processes’ at once. Threading gives us parallel execution.
we use the modules threading and queue to start several threads. A queue is created by calling Queue(). Then we have an array of urls as parameter for thread construction.
Threads are created in the for loop using the call threading.Thread(). Then they have to be started by calling thead.start(). Every thread calls the method getUrl.
Graphically this is what happens. Your program (the main thread) starts several new threads which execute a task “in parallel”.
A program can have any number of threads, each of which work on some data.