In c# im creating my threads like this:
void LaunchThread(string url, string search, string regexstring)
{
new Thread(delegate()
{
Scrape(url, search, regexstring,false);
}).Start();
}
and I use an INT variable to follow how many threads are currently running but i have a feeling it can be a little wonky at times and not be accurate (due to when you time the check on how many exist)
I have 2 questions:
- Is there a variable that could tell me how many threads are currently running
- Is there a way to close/exit all threads mid way not waiting for them to complete?
thanks alot SO im new to c# and multitasking as a whole