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 / sabu

using System;
using System.Threading;
namespace ConsoleApplication1
{
class Class1
{
static void PrintHelloFromThreadName()
{
Console.WriteLine("Hello, from thread {0}",
Thread.CurrentThread.Name); // {0}
}
public void ThreadStart()
{
PrintHelloFromThreadName();
}
static void Main(string[] args)
{
Thread.CurrentThread.Name = "Main thread";
Class1 obj = new Class1();
Thread thread = new Thread(
new ThreadStart(obj.ThreadStart));
thread.Name = "Forked thread";
thread.Start();
PrintHelloFromThreadName();
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

object is physical and class is logical..here class is not occupying any memory as our definition of class but i got a question then the class where it stores if it is not occupying any memory....

2092


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

1067


What are the new features of Framework 1.1 ?

16649


How will you do redo and undo in textbox control?

1040


Explain what are the deferred execution and the immediate execution in linq?

1038


What is common type system (cts)?

985


what is the meaning silverligt control

2113


What does stateless mean?

1056


Explain can 2 different applications use the same dll in gac at the same time?

1089


Explain me why do we use msmq?

1028


Is .net front end or backend?

1035


How do I spawn a thread?

949


What is assembly in .net?

1038


Explain me what is the .net framework and how does it work?

1079


Define satelite assembly?

1052