[Mono-bugs] [Bug 664639] New: Spawning a new thread using BackgroundWorker, the new thread will be blocked until original thread ends

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 14 13:49:53 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=664639

https://bugzilla.novell.com/show_bug.cgi?id=664639#c0


           Summary: Spawning a new thread using BackgroundWorker, the new
                    thread will be blocked until original thread ends
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.8.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jbebeau at castlegarde.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer
           Blocker: No


Description of Problem:

The situation is like this:  1) main thread, Thread-A spawns a WorkerBackground
thread Thread-B.  Work running under the WokerBackground (Thread-B) spawns a
new thread Thread-C.  This new, Thread-C is blocked until Thread-B ends.  

Steps to reproduce the problem:

using System;
using System.ComponentModel;
namespace TestBackgroundWorker
{
      class MainClass
      {
            public static void Main (string[] args)
            {
                  BackgroundWorker thread_B = new BackgroundWorker();
                  thread_B.DoWork += HandleWorkerDoWork;
                  thread_B.RunWorkerAsync();
                  System.Threading.Thread.Sleep(new TimeSpan(0,0,5));
                  Console.WriteLine ("End of Main Thread(Thread_A)");
            }
            static void HandleWorkerDoWork (object sender, DoWorkEventArgs e)
            {
                  BackgroundWorker thread_C = new BackgroundWorker();
                  thread_C.DoWork += HandleWorkerDoWork1;
                  thread_C.RunWorkerAsync();
                  System.Threading.Thread.Sleep(new TimeSpan(0,0,3));
                  Console.WriteLine("end of Thread B");
            }
            static void HandleWorkerDoWork1 (object sender, DoWorkEventArgs e)
            {
                  Console.WriteLine("Begin of Thread C");
            }     
      }

}

Actual Results using Mono 2.8.1 runtime:

  end of Thread B
  Begin of Thread C
  End of Main Thread(Thread_A)
  Press any key to continue . . .


Expected Results Microsoft .NET runtime:

  Begin of Thread C
  end of Thread B
  End of Main Thread(Thread_A)
  Press any key to continue 

How often does this happen? 
  Always

Additional Information:

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list