MGZ NetArt

Software Development and Support

Home
Design Patterns
C# Tips
MRDS Examples
Concurrent Execution
Task Activation
Iterator
Receivers and Arbiters
Resume
Contact Us
In Addition to Concurrent Execution Example you can pass a parameter to a new Task


Arbiter.Activate(new DispatcherQueue("Test Q", new Dispatcher(1, "Test")), new Task<int>(20, SimpleHandler));

       

private void SimpleHandler(int count)

{

      for (int i = 0; i < count; i++)

          {

                Thread.Sleep(1000);

                Console.Write(i + " ");

          }

          Console.WriteLine("Finished Simple Handler Thread {0}",

          System.Threading.Thread.CurrentThread.ManagedThreadId);

}