This is the code I am using to call 3 threads.
for (int i = 0; i < 3; i++)
{
new Thread(() => { processEventLogTesting(); }) {IsBackground = true }.Start();
}
I was thinking about adjusting it to this
public static int ThreadCounter = 0;
if (ThreadCounter < 3)
{
ThreadCounter ++;
for (int i = 0; i < 3; i++)
{
new Thread(() =>
{
processEventLogTesting(/*somewhere in here code says */ThreadCounter--;);}) {IsBackground = true }.Start();
}
}
}
However, I think this is probably not the best way to do this. Also, I want to put in a new timer that says if thread x goes over 20 minutes, kill thread x. Any help is appreciated.