为什么只有一个线程被执行而其他线程没有
why is only one thread gets executed and other is not
import threading,time
def auto2():
while 1:
print ("hello master")
time.sleep(2)
def auto1():
while 1:
print "hello"
time.sleep(3)
x=threading.Thread(target=auto1(),args=())
y=threading.Thread(target=auto2(),args=())
x.start()
y.start()
import threading, time
def auto2():
while 1:
print("hello master")
time.sleep(2)
def auto1():
while 1:
print ("hello")
time.sleep(3)
x = threading.Thread(target=auto1)
y = threading.Thread(target=auto2)
x.start()
y.start()
target=auto1() -> target=auto1
import threading,time
def auto2():
while 1:
print ("hello master")
time.sleep(2)
def auto1():
while 1:
print "hello"
time.sleep(3)
x=threading.Thread(target=auto1(),args=())
y=threading.Thread(target=auto2(),args=())
x.start()
y.start()
import threading, time
def auto2():
while 1:
print("hello master")
time.sleep(2)
def auto1():
while 1:
print ("hello")
time.sleep(3)
x = threading.Thread(target=auto1)
y = threading.Thread(target=auto2)
x.start()
y.start()
target=auto1() -> target=auto1