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 can the validation be done in the server side? Or this can be done only in the client side?
Difference between user groups and code groups
How can you see which services are running on a Windows box?
What is your observations between vb.net and vc#.net?
Explain dataset.acceptchanges and dataadapter.update methods in .net?
Is .net core managed code?
Explain the Difference between value and reference type.
I am constantly writing the drawing procedures with system.drawing.graphics, but having to use the try and dispose blocks is too time-consuming with graphicsobjects. Can I automate this?
Write code for fetch record nos 15 to 25 from a dataset containing 50 records?
Where does the dispose method lie and how can it be used to clean up resources?
Explain what is the difference between encrypting a password and applying a hashing?
What are the main components in .net?