.NET Thread Pool - Unresponsive WinForms UI

前端 未结 5 871
说谎
说谎 2021-01-22 07:48

Scenario

I have a Windows Forms Application. Inside the main form there is a loop that iterates around 3000 times, Creating a new instance of a class on a new thread to

5条回答
  •  执笔经年
    2021-01-22 08:28

    If every thread logs something to your ui, every written log line must invoke the main thread. Better to cache the log-output and update the gui only every 100 iterations or something like that.

提交回复
热议问题