Write the sample code for threading in c# .net..
Answers were Sorted based on User's Feedback
Answer / alcheringa
// this is the function that we want to invoke in a new
static void doit()
for (int i=0 ; i < 10; i++)
// this is the main fucntion
public static void main()
// threadstart is the delegate
// we need to pass the method, ts accept's method name as
threadstart ts=new threadstart(doit);
// this is how we define a new thread
thread tr=new thread(ts);
// we invoke the thread
|Is This Answer Correct ?||22 Yes||10 No|
Answer / gby
question to Alcheringa?
So why did you define int i? ????
|Is This Answer Correct ?||8 Yes||5 No|
Answer / sivakumar v
Static Void Run()
Console.WriteLine("Thread Is Running");
static void Main()
Thread TrdObj=new Thread(Run);//create the obj
|Is This Answer Correct ?||3 Yes||1 No|
Answer / maryada ramana
first uhave to learn c#.net then u will undertsand how much
diff is .net useless fellow Alcheringa a prentra alcherenga
|Is This Answer Correct ?||3 Yes||4 No|
Why is it efficient to use System.string under System.Text.StringBuilder ?
What is base class in c#?
How do you remove white spaces from a string?
What are fields in c#?
what is unit testing
What is use of console?
In which way you can convert a value-type to a reference-type?
Explain how can I get around scope problems in a try/catch?
Why should I use interface in c#?
What is an indexer in c#?
What?s the difference between System.String and System.StringBuilder classes?
How do I count the length of a string in c#?