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?

Answers were Sorted based on User's Feedback



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

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

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

Answer / guest

System.Threading.Thread

Is This Answer Correct ?    9 Yes 5 No

Post New Answer

More Dot Net General Interview Questions

What does jit compilation do in .net?

0 Answers  


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

0 Answers  


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

0 Answers   Infotech, Wipro,


What is JIT and how is works?

3 Answers  


How do you give a Windows service specific permissions?

1 Answers  


Explain difference between panel and groupbox classes using .net?

0 Answers  


Please explain what is a delegate?

0 Answers  


What is COM Interoperability in .NET

0 Answers  


How to spawn a thread?

0 Answers  


What are the difference bbetween value type & reference types ? Example from .net. Integer & struct are value types or reference types in .net?

0 Answers  


Is atl redundant in the .net world?

0 Answers  


Explain asp.net?

0 Answers  


Categories