Need some help in thread programming
Please help me on this. I need to do the following:
1) I need to execute a shell script through java program and write the output of the script to the file
2) If the execution of the shell script takes more than 10 mins, I should kill the process. This monitoring should be done in a separate thread.
3) Also I need to monitor the CPU/Memory of the process fives times with an interval of 10 mins, If the cpu of the process is high (>70) all the times then I need to kill the process. This should be done in a separate thread.
As am new to threading , could someone help me on this coding ?