thread get 100% CPU very fast

后端 未结 5 1203
轮回少年
轮回少年 2021-01-18 07:44

I am implementing a very basic thread in C#:

private Thread listenThread;

public void startParser()
{
   this.listenThread = new Thread(new ThreadStart(chec         


        
5条回答
  •  一向
    一向 (楼主)
    2021-01-18 08:03

    Let your loop sleep. It's running around and around and getting tired. At the very least, let it take a break eventually.

提交回复
热议问题