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

Explain the difference between the stack and the heap?

979


hai, about trading domain and need simple project on trading system. please help me...

2074


what is the default security setting in .net?

998


Difference between machine.config and web.config?

1044


Explain how to stop a thread?

1055


Explain what are possible implementations of distributed applications in .net?

991


How many design patterns can be created in .net?

1021


If I am writing in a language like vb or c++, what are the procedures to be followed to support .net?

1017


Is .net core managed code?

1012


What's wrong with a line like this? Datetime.parse(mystring);

1021


What are the collections you've used?

1065


What is Event Bubbling in .NET?

1114


How to implement CAS in .Net?

2847


What is data type and how many types of data types are in .NET ?

1087


What is the difference between reference type and value type?

938