Skip to content

Commit

Permalink
Create MultiThread.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Isha307 authored Jul 1, 2022
1 parent fa4259b commit 3937409
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions OS/Thread/MultiThread.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3937409

Please sign in to comment.