How do you create threading in .NET? What is the namespace
for that?
Answers were Sorted based on User's Feedback
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 |
Explain me how does linq work?
you have a requirement from client, he has an XML file and you need to insert the data into 5-6 tables in database. explain me the procedure.
What?s different about a Windows service as compared to a regular application?
What are the different types of assemblies?
Explain what is the difference between web application and enterprise application?
Where does the dispose method lie and how can it be used to clean up resources?
Is .net core installed?
Please explain what do the terms “boxing” and “unboxing” mean?
Explain the purpose of Remoting in .NET?
0 Answers Petranics Solutions,
What is Nothing permission set in .Net
What method do you use to explicitly kill a users session? How?
Explain what is the difference between response.redirect & server.transfer?