[Mono-bugs] [Bug 62060][Maj] New - Threads hang on amd64 mono 1.0

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 28 Jul 2004 15:01:54 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by medvitz@medvitz.net.

http://bugzilla.ximian.com/show_bug.cgi?id=62060

--- shadow/62060	2004-07-28 15:01:54.000000000 -0400
+++ shadow/62060.tmp.13325	2004-07-28 15:01:54.000000000 -0400
@@ -0,0 +1,108 @@
+Bug#: 62060
+Product: Mono: Class Libraries
+Version: unspecified
+OS: other
+OS Details: Mandrake 10.0 Official AMD64
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: medvitz@medvitz.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Threads hang on amd64 mono 1.0
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Child Threads hang on amd64
+
+Steps to reproduce the problem:
+1. Compile Sample code (from Microsoft's Thread Class doc)
+using System;
+using System.Threading;
+
+// Simple threading scenario:  Start a static method running
+// on a second thread.
+public class ThreadExample {
+    // The ThreadProc method is called when the thread starts.
+    // It loops ten times, writing to the console and yielding 
+    // the rest of its time slice each time, and then ends.
+    public static void ThreadProc() {
+        for (int i = 0; i < 10; i++) {
+            Console.WriteLine("ThreadProc: {0}", i);
+            // Yield the rest of the time slice.
+            Thread.Sleep(0);
+        }
+    }
+
+    public static void Main() {
+        Console.WriteLine("Main thread: Start a second thread.");
+        // The constructor for the Thread class requires a ThreadStart 
+        // delegate that represents the method to be executed on the 
+        // thread.  C# simplifies the creation of this delegate.
+        Thread t = new Thread(new ThreadStart(ThreadProc));
+        // Start ThreadProc.  On a uniprocessor, the thread does not get 
+        // any processor time until the main thread yields.  Uncomment 
+        // the Thread.Sleep that follows t.Start() to see the difference.
+        t.Start();
+        //Thread.Sleep(0);
+
+        for (int i = 0; i < 4; i++) {
+            Console.WriteLine("Main thread: Do some work.");
+            Thread.Sleep(0);
+        }
+
+        Console.WriteLine("Main thread: Call Join(), to wait until
+ThreadProc ends.");
+        t.Join();
+        Console.WriteLine("Main thread: ThreadProc.Join has returned. 
+Press Enter to end program.");
+        Console.ReadLine();
+    }
+}
+2. run
+
+
+Actual Results:
+$ mint test2.exe
+Main thread: Start a second thread.
+Main thread: Do some work.
+Main thread: Do some work.
+Main thread: Do some work.
+Main thread: Do some work.
+Main thread: Call Join(), to wait until ThreadProc ends.
+
+
+Expected Results:
+Main thread: Start a second thread.
+Main thread: Do some work.
+ThreadProc: 0
+Main thread: Do some work.
+ThreadProc: 1
+Main thread: Do some work.
+ThreadProc: 2
+Main thread: Do some work.
+ThreadProc: 3
+Main thread: Call Join(), to wait until ThreadProc ends.
+ThreadProc: 4
+ThreadProc: 5
+ThreadProc: 6
+ThreadProc: 7
+ThreadProc: 8
+ThreadProc: 9
+Main thread: ThreadProc.Join has returned.  Press Enter to end program.
+
+How often does this happen? 
+Every Time
+
+Additional Information:
+
+Running mono 1.0 from 7/15/2004 (latest) on amd64 with Mandrake 10.
+Compiled with pthreads.  Was first recognized when XSP wouldn't run
+properly.....