I
ipramod
Hi,
I am having an application which inserts some data into a table. While
inserting table rows, I want to check CPU percentage and if it is >90%
then I want to sleep insertion for some time and then again resume
it.
For example:
-> Main execution starts
-> Main starts inserting rows into table
-> Check CPU %
-> while ( CPU % > 90 )
-> Sleep(10000)
-> End inserting
-> End Main
Now if I create one thead to insert table values and second thread to
check CPU % from the main thread, then can we sleep the insertion
thread from the main thead? Main thead waits till the insertion
completes.
Please let me know your thoughts or any other way to resolve this
issue.
Regards,
PI
I am having an application which inserts some data into a table. While
inserting table rows, I want to check CPU percentage and if it is >90%
then I want to sleep insertion for some time and then again resume
it.
For example:
-> Main execution starts
-> Main starts inserting rows into table
-> Check CPU %
-> while ( CPU % > 90 )
-> Sleep(10000)
-> End inserting
-> End Main
Now if I create one thead to insert table values and second thread to
check CPU % from the main thread, then can we sleep the insertion
thread from the main thead? Main thead waits till the insertion
completes.
Please let me know your thoughts or any other way to resolve this
issue.
Regards,
PI