Unresponsive UI when using BeginInvoke

前端 未结 3 1709
野性不改
野性不改 2021-01-24 15:22

Bckground
I have a networked application written in C#. my server program has a UI and several communication threads, that read from tcp sockets and display

3条回答
  •  醉话见心
    2021-01-24 15:51

    Invoke shouldn't lead to deadlocks unless you own a lock while you're doing the invoking... but BeginInvoke shouldn't make the UI unresponsive either. Could the problem be that you're simply trying to update the textbox too often? Perhaps buffer the incoming text more? For example, only update the UI once every half second rather than any time you read any data.

提交回复
热议问题