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...

Write the sample code for threading in c# .net..

Answer Posted / alcheringa

using system.threading;
// this is the function that we want to invoke in a new
thread

static void doit()
{
for (int i=0 ; i < 10; i++)
{
console.writeline("doing somethin");
}
}
// this is the main fucntion

public static void main()
{
// threadstart is the delegate
// we need to pass the method, ts accept's method name as
the parameter
threadstart ts=new threadstart(doit);
// this is how we define a new thread

thread tr=new thread(ts);
// we invoke the thread
tr.start()
conosle.readline();
}

Is This Answer Correct ?    22 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is helper method in c#?

872


What is uint64?

901


What are the Types of configuration files and their differences

1013


What is native image generator (ngen.exe)?

1176


Is a structure a class?

896


What is difference between array and list in c#?

817


Explain about Threading Types.

1007


What is lock statement in C#?

956


What is list collection in c#?

912


What is array collection?

899


What is autopostback in c#?

890


Illustrate serialization?

896


Is it possible to inherit multiple interfaces?

960


Is stringbuilder thread safe c#?

820


When was c# created?

932