单任务现象

import time

def run1():
    while 1:
        print("sunck is a good man")
        time.sleep(1)

def run2():
    while 1:
        print("sunck is a nice man")
        time.sleep(1)

if __name__ == "__main__":
    run1()
    # 不会执行run2()方法,只有上面的run1()结束才可执行run2()
    run2()

 

单任务现象,永远都不会执行到run2任务

posted @ 2019-04-23 20:14  wygbbb  阅读(119)  评论(0编辑  收藏  举报