• Log in or sign up for an account here: https://www.sythe.org/login

[Global]Reported Post by blindkilla

Status
Not open for further replies.

blindkilla

Guru

$25 USD Donor New
Joined
Jun 22, 2005
Sythe Gold
6
Messages
1,896
Location
Canada
blindkilla has reported a post.

Reason:
Spam. He's just creating backlinks.
Post: Multi Threadding in C#.NET
Forum: C#
Assigned Moderators: N/A

Posted by: robinson1
Original Content:
A thread is defined as a path of execution for the given process task or function.
A thread is normally classified into:Single thread, Multiple thread
In single thread only one function or operation is executed at a time.
In multi thread ,we force to perform two more operation or function to execute simultaneously.
In .net every program is single thread by default.
Example of Multi Threadding is given below:

using System;
using System.Threading;
class threaddem
{
public threaddem()
{
Thread td = new Thread(new ThreadStart(show));
td.Start();
}
static void show()
{
for (int i = 0; i <= 10; i++)
{
Console.WriteLine("Secondary Thread {0} called with id {1}", i, Thread.CurrentThread.GetHashCode());
Thread.Sleep(1000);
}
}
}

class Program
{
static void Main()
{
threaddem td1 = new threaddem();
for (int i = 0; i <= 10; i++)
{
Console.WriteLine("Primary Thread {0} called with id {1}", i, Thread.CurrentThread.GetHashCode());
Thread.Sleep(1000);
}
}
}
}
............
Job Openings
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top