Can u create multiple threads of execution ?
Answer / tina
using System;
using System.Threading;
class MyThread {
public int count;
public Thread thrd;
public MyThread(string name) {
count = 0;
thrd = new Thread(new ThreadStart(this.run));
thrd.Name = name;
thrd.Start();
}
// Entry point of thread.
void run() {
Console.WriteLine(thrd.Name + " starting.");
do {
Thread.Sleep(500);
Console.WriteLine("In " + thrd.Name +
", count is " + count);
count++;
} while(count < 10);
Console.WriteLine(thrd.Name + " terminating.");
}
}
public class MoreThreads {
public static void Main() {
Console.WriteLine("Main thread starting.");
// Construct three threads.
MyThread mt1 = new MyThread("Child #1");
MyThread mt2 = new MyThread("Child #2");
MyThread mt3 = new MyThread("Child #3");
do {
Console.Write(".");
Thread.Sleep(100);
} while (mt1.count < 10 ||
mt2.count < 10 ||
mt3.count < 10);
Console.WriteLine("Main thread ending.");
}
}
Is This Answer Correct ? | 4 Yes | 1 No |
What is the Difference between read only and constant variables?
If you want to write your own dot net language, what steps you will u take care?
What’s the difference between System.String and System.Text.StringBuilder classes with example
How do you mark a method obsolete?
What are lambda expressions used for?
What is the difference between “constant” and “readonly” variables in c#?
WHAT ARE Design Patterns USING IN DOTNET
What is the difference between dispose() and finalize() methods in c#?
What is the difference between string keyword and system.string class?
Explain ACID rule of thumb for transactions.
i have a table named login in mysql database containing (empid,fname,lname,mobno,emailid,usrname,usrpwd) i have 2 textboxes in which i enter my username and pwd..so based on what is entered in those textboxes it should retreive all other details of dat username in the remaining 6 textboxes..i want the code for this...
Which layer executed first among these Application layer,Buisness layer or Data Base Layer?