If you can dream IT, You can become it, If you can think IT, You can do IT,If you can believe it ,you can achieve IT.
like
Monday, January 13, 2014
Sunday, January 12, 2014
Foreground and Backgound Thread
using System;
using System.Threading;
namespace _4ThreadApplication
{
class Program
{
static void Main(string[] args)
{
//Thread objThread = new Thread(CallToPrintMethod);
//objThread.Start();
//All the 4 virtual cpu usesage by this application.[their are 4 blocks]
for (int i = 0; i < 4; i++)
{
Thread objThread = new Thread(CallToPrintMethod);
//Uncomment below line if you want to make this Foreground Thread to Background Thread for applicaiton.
// objThread.IsBackground = true;
objThread.Start();
}
}
private static void CallToPrintMethod(object obj)
{
while (true)
{
Console.WriteLine("This is Testing for CPU usesage.");
}
}
}
}
using System.Threading;
namespace _4ThreadApplication
{
class Program
{
static void Main(string[] args)
{
//Thread objThread = new Thread(CallToPrintMethod);
//objThread.Start();
//All the 4 virtual cpu usesage by this application.[their are 4 blocks]
for (int i = 0; i < 4; i++)
{
Thread objThread = new Thread(CallToPrintMethod);
//Uncomment below line if you want to make this Foreground Thread to Background Thread for applicaiton.
// objThread.IsBackground = true;
objThread.Start();
}
}
private static void CallToPrintMethod(object obj)
{
while (true)
{
Console.WriteLine("This is Testing for CPU usesage.");
}
}
}
}
Subscribe to:
Posts (Atom)

inC%23.png)
