Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you create threading in .NET? What is the namespace
for that?

Answer Posted / ashish omar

The namespace to use multithreading in .Net is "using
System.Threading;"

Live Example to demonstrate how multithreading can be
achieved in .Net.

C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace DataAccess
{
class Thread_Excesise
{
public void Child_Thread()
{
for (int i = 0; i < 10; ++i)
{
Console.WriteLine(" Child_Thread with
Count" + i);
Thread.Sleep(100);
}

}

static void Main(string[] args)
{
Thread_Excesise inst = new Thread_Excesise();
for (int i = 0; i < 10; ++i)
{
Console.WriteLine("Main Thread");
Thread t = new Thread(inst.Child_Thread);
t.Start();
Thread.Sleep(1000);
}
}
}
}


Code posted by "Ashish Omar"

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of .net?

944


What does mean by .net framework?

1049


Interop Services?

1893


Do you know what is the difference between an abstract class and an interface?

959


When we go for html server controls and when we go for web server controls?

1072


Explain about the features and elements present in Visual studio.NET IDE?

1028


What is the difference between web application and enterprise application?

1028


Describe the use of following com+ services jit activation, queued components, object pooling.?

912


Explain the difference between the while and for loop.

941


Tell me what is a “jagged array”?

994


What is the difference between .net 2000 and .net 2005(features)? Which one is better?

917


If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

2031


What are three common acronyms used in .net, and what do they stand for?

956


How will you load an assembly which is not referenced by current assembly?

949


What are the important components of .net?

952