none
VS 2005 RC1 problem with BackgroundWorker or threads in general? RRS feed

  • Question

  • Has anyone worked with RC1 and if so, have you encountered any problems with threading and BackgroundWorker specifically.  We are seeing about a 10 second delay before the DoWork gets called.  Also the painting of the forms is sluggish in general.  We have installed this on several machines and have had the same problems on each.

    Thanks,
    Tuesday, September 27, 2005 7:44 PM

Answers

  • I haven't seen this problem.  Are you still seeing it?  It sounds like what you're describing is less a problem with BackgroundWorker, and more a problem of something making your events slow.  Any chance you're doing something in an event that takes a really long time?

         -Scott

    Monday, January 23, 2006 7:44 PM
    Moderator

All replies

  • Hello,

    Rico Mariani has a great CLR Performance blog available at: http://blogs.msdn.com/ricom/

    He also links to a Performance Wiki at: http://channel9.msdn.com/wiki/default.aspx/Channel9.RicoM

    Those two resources should be helpful in narrowing down where the performance regression is coming from. Please feel free to post back to this thread if you can find more technical details on the regression.

    Hope that helps,
    Stephen [Microsoft Common Language Runtime: Security - Developer]
    http://blogs.msdn.com/stfisher
    Thursday, September 29, 2005 5:30 AM
    Moderator
  • Hi Rico,

    I'm not sure I understand the point of the Blogs towards answering the problems I am seeing.  I was running this code just fine on Beta 2 and then uninstalled and installed RC1 expecting better performance and then having all kinds of problems with threading.  If there are some CLR settings I can change or tweak then I understand (and could use a point in the right direction) but I don't see any code changes that I can make that will help.

    Basically I created a project to show the problem by creating a simple Windows Application that has one form with a BackgroundWorker and a label.  In the DoWork, call Interlocked.Increment on a integer and in the RunWorkerCompleted event, put the string of the integer in to the Text of a Label.  Then call RunWorkerAsync in the tick of a timer set for 1000 milliseconds.

    Works like a charm in Beta 2.  In RC1 it waits approx. 10 seconds (consistently) before the DoWork gets called.  So, what you get is a 10 second counter at a minimum.  If you remove all code from the DoWork, the second call crashes the App.

    I'm sure this will not reproduce in the latest internal build but I am trying to work wtih RC1 since I do not have internal builds available to me.  I can't demo the App we are working on as a proof of concept with the threading not working so we have uninstalled RC1 and put Beta 2 back on just so that it will work again.  This causes it's own set of problems of course as the uninstall of RC1 doesn't clean up after itself so you have to manually delete some assembly in the GAC and copy ones from Beta 2 back in.

    It's a bit disconcerting that there won't be any release between RC1 and RTM when there are so many problems with threading that we can't work with RC1 to find other problems.

    Thanks,
     
    Thursday, September 29, 2005 8:15 PM
  • I haven't seen this problem.  Are you still seeing it?  It sounds like what you're describing is less a problem with BackgroundWorker, and more a problem of something making your events slow.  Any chance you're doing something in an event that takes a really long time?

         -Scott

    Monday, January 23, 2006 7:44 PM
    Moderator
  • Thanks for the reply.  No this behavior was fixed sometime after RC1 but of course was not released until RTM.  As soon as we put the RTM release on it worked without any code changes.

    Thanks,

    Monday, January 23, 2006 11:18 PM