I found this book on internet: Threading in C# by Joseph Albahari. I tried its example:
class ThreadTest
{
static void Main()
{
Thread t = new Thread(WriteY); // Kick off a new thread
t.Start(); // running WriteY()
// Simultaneously, do something on the main thread.
for (int i = 0; i < 10000000; i++) Console.Write("x");
Console.ReadLine();
}
static void WriteY()
{
for (int i = 0; i < 10000000; i++) Console.Write("y");
}
}
The problem is, when I run this program (I gave higher values in for loops to observe) my CPU utilization sticks to 100%. I didn't want this, I mean, is there anyway to reduce to make this program less CPU intensive? I am just new to multithreading concept so I thought I should ask in advance.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)