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 |
How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?
Tell us what is the native image generator?
What is func in .net 3.5?
Explain the difference between static page and dynamic page?
Please tell us what is the difference between override and overload in a method?
Explain what is an application domain?
What is difference between .net and .net core?
Describe ways of cleaning up objects.
What is .net latest version?
What is the difference between asp.net and asp?
What is the difference between override and overload in a method?
What is a variable of implicit type and what is its scope?