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.
精彩评论