Q:

Python program to illustrate multithreading

belongs to collection: Python Threading Programs

0

Multithreading is executing multiple threads concurrently by the processor.

In programming, a process can have two or more threads.

Here, we will see a program to create multiple threads in python

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Python program to show the working of multithreading

import threading

def ProcessOne():
    while(True):
        print("Process One")
def ProcessTwo():
    while(True):
        print("Process Two")

T1=threading.Thread(target=ProcessOne)
T2=threading.Thread(target=ProcessTwo)

T1.start()
T2.start()

Output:

Process One
Process Two
...
...

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python program to create and delete threads using ... >>
<< Python Program to illustrate parameterized threads...