TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Create Multiple Thread in C#
Rajan Singh
Dec 29
2015
Code
1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Threading;
namespace
MultipleThread
{
class
Program
{
static
void
Main(
string
[] args)
{
Thread thread =
new
Thread(DefferentThread);
thread.Start();
while
(
true
)
{
Console.WriteLine(
"This is MainThread"
);
}
}
static
void
DefferentThread()
{
while
(
true
)
{
Console.WriteLine(
"This is DefferentThread"
);
}
}
}
}
Output:
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is MainThread
This is MainThread
Multiple Thread
C#