Multi-Threading Program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace MultiTheadingAbort  
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread th = new Thread(writey);
            if (th.IsAlive)
            {
                th.Start();
                th.Abort();
            }
            for (int i = 0; i <= 10;i++ )
            {
                Console.WriteLine("hello");
            }
            Console.Read();
        }

        private static void writey()
        {
            for (int i = 0; i <= 9;i++ )
            {
                Console.WriteLine("kul");
            }
        }

    }
}

Share:

No comments:

Post a Comment

Monday, 31 August 2015

Multi-Threading Program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace MultiTheadingAbort  
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread th = new Thread(writey);
            if (th.IsAlive)
            {
                th.Start();
                th.Abort();
            }
            for (int i = 0; i <= 10;i++ )
            {
                Console.WriteLine("hello");
            }
            Console.Read();
        }

        private static void writey()
        {
            for (int i = 0; i <= 9;i++ )
            {
                Console.WriteLine("kul");
            }
        }

    }
}

No comments:

Post a Comment

Popular

Total Pageviews

Archive