Threads
are subtasks in a program that can be in execution concurrently.
The
concurrency that computers perform today is normally implemented as operating
system primitives” available only to highly experienced “systems programmers.”
Namespace: using System.Threading
C# Code:
namespace threads
{
class Program
{
static void Main(string[] args)
{
Thread t = new Thread(new ThreadStart(threadMethod));
t.Start();
Console.ReadLine();
}
public static void threadMethod()
{
Console.WriteLine("Thread is running");
Thread.Sleep(10000);
}
}
}
No comments:
Post a Comment