单任务现象

Posted wuygblog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了单任务现象相关的知识,希望对你有一定的参考价值。

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任务

以上是关于单任务现象的主要内容,如果未能解决你的问题,请参考以下文章