G
Gopal Prabhakaran
Hi Guys
How to Get the alive Thread Count.
Sample code :
using System;
using System.Threading;
namespace threadSample
{
/// <summary>
/// Summary description for ThreadsCollection.
/// </summary>
public class ThreadsCollection
{
private Thread testThread;
public ThreadsCollection()
{
//
// TODO: Add constructor logic here
//
}
static void Main(string[] args)
{
s.threadsStart();
Console.WriteLine(s.testThread.Name.ToString());
}
private void threadsStart()
{
for(int i=0;i<3;i++)
{
testThread = new Thread(new ThreadStart(this.threadWorker));
testThread.Name = "Prabharkan" + i;
this.testThread.Start();
}
}
private void threadWorker()
{
while(true)
{
}
}
}
Now I want to get total number thread running with name
Pls help me to find out a way
(Without dumpping all the started threads in arraylist...)
How to Get the alive Thread Count.
Sample code :
using System;
using System.Threading;
namespace threadSample
{
/// <summary>
/// Summary description for ThreadsCollection.
/// </summary>
public class ThreadsCollection
{
private Thread testThread;
public ThreadsCollection()
{
//
// TODO: Add constructor logic here
//
}
static void Main(string[] args)
{
s.threadsStart();
Console.WriteLine(s.testThread.Name.ToString());
}
private void threadsStart()
{
for(int i=0;i<3;i++)
{
testThread = new Thread(new ThreadStart(this.threadWorker));
testThread.Name = "Prabharkan" + i;
this.testThread.Start();
}
}
private void threadWorker()
{
while(true)
{
}
}
}
Now I want to get total number thread running with name
Pls help me to find out a way
(Without dumpping all the started threads in arraylist...)