开发者

Is BackgroundWorker suitable for long-running operation?

any idea suggestion about BGW for long-runn开发者_C百科ing operation?


Yes it is :). There is nothing inherently wrong in having long-running operations in a BackgroundWorker or a ThreadPool... if there are deadlocks in the code because of long-running operations, then there is something wrong with the code.


Suggestion: allow your operation to cancel. BGW allows for this by setting a bool property. You need to periodically check this property in your DoWork method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜