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

What are the features of dot net?

1048


What are the new thee features of com+ services, which are not there in com (mts)?

933


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

951


What is alias ? Is it used in .Net ?

1061


Who is using .net core?

928


What is a windows process in .net?

1000


what is the meaning silverligt control

2077


How will you register com+ services?

1991


What is the benefit of .net core?

923


How do I spawn a thread?

917


Explain the difference between vb and vb.net?

998


Do you know what's the difference between .net and laravel?

1052


What is the difference between "using system.data;" and directly adding the reference from "add references dialog box"?

1061


State some of the different languages supported by .net?

952


Differentiate between managed and unmanaged code?

1081