المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Theading problem



C# Programming
10-24-2009, 01:11 AM
Dear all,

Could anyone please help me with the following problem. I have a MainForm in my application. I call a background worker thread to do some work. This thread never finishes, so it will always run in the background and will be closed when the application closes. This works perfect. Then I open a new form from my main thread and in that form I call another backgroundworker. As long as backgroundworker 2 is running, backgroundworker 1 becomes unresponsive. The MainForm stays responsive, the newly opened form stays responsive, but the two backgroundworkers don't seem to like each other and seems to be competing over resources.

* MainForm - backgroundworker 1
* subForm - backgroundworker 2

When backgroundworker 2 is running, backgroundworker 1 becomes unresponsive until backgroundworker 2 is finished.

Weird huh ?

Kind regards,