From 3937409bd845382a552cadda8a30ac5a01d5e918 Mon Sep 17 00:00:00 2001 From: isha <56998032+Isha307@users.noreply.github.com> Date: Fri, 1 Jul 2022 09:51:04 +0530 Subject: [PATCH] Create MultiThread.py --- OS/Thread/MultiThread.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 OS/Thread/MultiThread.py diff --git a/OS/Thread/MultiThread.py b/OS/Thread/MultiThread.py new file mode 100644 index 0000000..bb9a76b --- /dev/null +++ b/OS/Thread/MultiThread.py @@ -0,0 +1,24 @@ +from threading import Thread +from time import * + +class hello(Thread): + def run(self): + for i in range(5): + print("hello") + sleep(1) + +class hii(Thread): + def run(self): + for i in range(5): + print("hii") + sleep(1) + +t1=hello() +t2=hii() +t1.start() +t2.start() + +t1.join() +t2.join() + +print("bye") #main thread call