[Mono-bugs] [Bug 671586] New: Using Task.Factory.StartNew will not create new Tasks if previous Task is blocked

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 13 17:17:16 EST 2011



           Summary: Using Task.Factory.StartNew will not create new Tasks
                    if previous Task is blocked
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: cdmckay at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13

I've made a program that creates Tasks using Task.Factory.StartNew to create
new Tasks that block using ManualResetEvents under certain circumstances.  It
seems that Task.Factory.StartNew will not create new tasks if a previous Task
is blocking using either ManualResetEvents#WaitOne or Thread.Sleep().

Reproducible: Always

Steps to Reproduce:
1. Run a Task that blocks on a ManualResetEvent.
2. Try to run another Task while previous Task is still blocked or sleeping.
Actual Results:  
Task 99 Started
Task 2 Started
Task 98 Started
Task 0 Started

Expected Results:  
Task 0 Started
Task 1 Started
Task 3 Started
Task 2 Started
Task 4 Started
Task 5 Started
.. 100 times ...

The attached code works as expected in the MS runtime but not in the Mono
runtime (only creates as many threads as there are threads on your CPU).

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