I use a MacBook Pro. Sometimes I want to pause the execution of a long heavy-duty experiment running on my system because I am on battery or for any other reason. Is there a way to do it in Eclipse ? Or even in Mac OS X itself ?
Since you mentioned you're running Linux, you can use the kill command with the -STOP and -CONT arguments might be a more appropriate option to pause and resume the process. where pid is the PID of your Java process. Another method would be to run your program in debug mode in Eclipse and pause it in the Debug view.
To pause the execution of a thread, we use "sleep()" method of Thread class.
You can suspend any process in Mac OS X (or any Unix) using the kill
command to send the SIGSTOP
signal to the process.
Find the process ID (pid) for example we'll say it's 9281.
kill -SIGSTOP 9281
and to resume...
kill -SIGCONT 9281
To find the pid, use the ps
command, ps -a
will list all running processes, your process will be a java
instance running your app.
You could start the application in debug mode and later pause it before setting the mac osx to sleep.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With