The Airplane always needs to check with the Airport to see if it has an
available runway before it's able to take off or land. Simulate the above-
mentioned scenario using multi-threading. IN python
import thread
import time
def checkRunway(name, runway):
if(runway>0):
print("There is available runway")
else:
print("There is no available runway")
n1=int(input("Enter nuber of available runway: "))
n2=int(input("Enter nuber of available runway: "))
try:
thread.start_new_thread( checkRunway, ("Thread 1", n1) )
thread.start_new_thread( checkRunway, ("Thread 2", n2) )
except:
print ("Error:")
while 1:
pass
Comments
Leave a comment