Dear All,
Happy to see you all again. I got some useful information from this forum. thats why i am asking. Please give me the valuable information.
I have to run 4 threads parallely in windows form. These Threads to be run on some intervals, so i put in While Loop that is,
The Variable Isavailable set as = true;
All thread are run in same way. If I want to Exit the application i just reset the variable in While Loop IsAvailable = false. and then abort the threads. In above 4 threads 2 thread functions are complicated so thats 2 threads are in running stage the application does not to be closed. After completion of 2 threads the application will be closed. so what i have to do?
And one more question is any other way to wait the thread. if i have put sleep mode its wastes the cpu time. Give your valuable Solution..
Thanks in Advance,
Sekar.
Happy to see you all again. I got some useful information from this forum. thats why i am asking. Please give me the valuable information.
I have to run 4 threads parallely in windows form. These Threads to be run on some intervals, so i put in While Loop that is,
Code:
While(IsAvailable)
{
Thread.Start();
Thread.Sleep(Timespan.FromSeconds(4));
}
All thread are run in same way. If I want to Exit the application i just reset the variable in While Loop IsAvailable = false. and then abort the threads. In above 4 threads 2 thread functions are complicated so thats 2 threads are in running stage the application does not to be closed. After completion of 2 threads the application will be closed. so what i have to do?
And one more question is any other way to wait the thread. if i have put sleep mode its wastes the cpu time. Give your valuable Solution..
Thanks in Advance,
Sekar.
Comment