JDK-4076796 : (process) Provide Process.isAlive(), like Thread.isAlive()
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.1.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-09-04
  • Updated: 2014-06-24
  • Resolved: 2014-05-07
Related Reports
Duplicate :  
Relates :  
Description
Name: joT67522			Date: 09/04/97


It would be useful, if java.lang.Process had a method like
'boolean isReady()' which returns, if the Process is still
running or if it had ended. When using waitFor(), one must
start a new Thread to do something meanwhile. I suppose,
it is relatively easy to implement such a method. I would like to write some code like shown below...
company - Uni Bielefeld, Technische Fakultät , email - ###@###.###
======================================================================

Comments
This issue implemented by 4244896
07-05-2014

EVALUATION Processes are a lot like Threads, and in fact on Linux they are implemented the same way, so it makes sense to bring the Thread and Process classes into closer alignment. Thread has an isAlive method, so it makes a lot of sense for Process to have such a method as well. Adjusting the synopsis to match. Implementation ought to be easy, but you never know with the win32 API.
24-08-2006

EVALUATION Process.isAlive(), maybe? Concern: how portable is this? anand.palaniswamy@Eng 1997-11-05 Process is definitely missing this functionality. Consider this new API for tiger. It is possible to determine whether the subprocess has completed by calling Process.exitValue(). If it throws an IllegalThreadStateException, then the subprocess hasn't completed. -- iag@sfbay 2001-11-07
07-11-2001

WORK AROUND Name: joT67522 Date: 09/04/97 Process p=Runtime.getRuntime().exec("SomeProgramm"); while(p.isRunning()) {doSomething();} // etc. ====================================================================== Call Process.exitValue(). If it throws an IllegalThreadStateException, the subprocess hasn't completed. -- iag@sfbay 2001-11-07
07-11-2001