Mono.MicroThreads.MicroThread.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
        public void Start()
        {
            if(m_state != MicroThreadState.Unstarted)
            {
                throw new Exception("Thread has already been started");
            }

            m_continuation = new Continuation();

            m_state = MicroThreadState.Starting;
            Scheduler.Add(this);
        }

Usage Example

Example #1
0
        static void Main()
        {
            DateTime time1 = DateTime.Now;

            s_channel = new Channel<int>();

            MicroThread t2 = new MicroThread(run2);
            t2.Start();

            MicroThread t3 = new MicroThread(run2);
            t3.Start();

            MicroThread t1 = new MicroThread(run1);
            t1.Start();

            Console.WriteLine("Starting producer/consumer test, loops {0}", s_loops);

            Scheduler.Run();

            DateTime time2 = DateTime.Now;

            Console.WriteLine("total {0}", res);
            Console.WriteLine("time {0}ms", (time2 - time1).TotalMilliseconds);
            Console.WriteLine("END");
        }
All Usage Examples Of Mono.MicroThreads.MicroThread::Start