How do you create threading in .NET? What is the namespace
for that?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kinjal
for threading namespace in .NET is
using System.Treading
static void Main(string[] args)
{
Thread.currenttread.name="k";
Console.WriteLine("name is {0}" , Thread.currentthread.name)
}
| Is This Answer Correct ? | 1 Yes | 1 No |
What is different between Web User Control and Web Custom Control?
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?
Is do-it (chennai) a good institute to learn dot-net???? are the trainers well experienced??
What is Entity Relationship Model in .NET?
What is a Strong Name?
How do you instantiate a complex number?
Explain me what is the difference between an abstract class and an interface?
How do you trigger the paint event in system.drawing?
Explain the top .net class that everything is derived from?
What's singlecall activation mode used for in .net?
How to customize the trace output?
What method do you use to explicitly kill a users session? How?