I am creating new thread everytime in the for loop .. but many times the loop takes the same filename and creates new thread.
Doesn't Work:
foreach (string s in fileEntries)
{
t = new Thread(() => Shrink(s));
t.Start();
}
I have tried individually for each file creating new thread hard coded providing the file name and it works fine.
Working / Needed:
Thread t = new Thread(() => Shrink(@"C:\abc.doc"));
t.Start();
Thread t1 = new Thread(() => Shrink(@"C:\123.doc"));
t1.Start();
But i have to take all the files in from a selected directory and create new thread for each in a loop.
Help would be appreciated.
Thanks