作者chilam22 (chilam)
看板LinuxDev
標題[問題] 請問kthread?
時間Sat Jan 10 16:08:50 2009
我在driver裡create兩個kernel thread,
thread A在loop裡輸出1, thread B在loop裡輸出2,
如果我在loop裡不做sleep之類放棄cpu的動作,
最後cpu就會一直被某個thread佔據,
不會有thread切換的情況.
所以是否kernel thread除非主動放棄,
不然會一直持有cpu?
不過書上寫kernel利用time sharing來切換process,
應該不會讓kernel thread一直持有cpu?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.14.29