Difference between BackgroundWorker and Thread?

前端 未结 7 1655
南旧
南旧 2020-12-07 00:58

What is the difference between BackgroundWorker and Thread? In my application I am using a messaging system that communicates with the database reg

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 01:40

    Use BackgroundWorker - it anyway encapsulates thread and is simpler to work with. One of the advantage with it is that its api allows simpler event based model to report progress and further, those event calls get correctly routed to UI thread (so that you don't have to do marshal the call using Invoke method).

提交回复
热议问题