python多線程的一點理解

理解這個其實須要懂一點操做系統的知識,不得不感嘆學科之間其實不少都是有聯繫的。python 其實多線程就好比泡麪的時候一邊燒開水一邊放醬料,兩不耽誤。多線程 在單核cpu中線程經過併發來實現cpu運算資源的高效使用併發 import time, threading # 新線程執行的代碼: def loop(): print('thread %s is running...' % thre
相關文章
相關標籤/搜索