ModelInference / synoptic

Inferring models of systems from observations of their behavior
Other
81 stars 25 forks source link

Stopping all child threads/process with addShutdownHook #383

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
During abnormal termination (e.g., csight process killed) we need to cleanup by 
stopping any running child processes (e.g., mcscm/spin). This needs to be done 
using the addShutdownHook:
http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#addShutdownHook%
28java.lang.Thread%29
http://stackoverflow.com/questions/6232499/stop-external-program-when-java-progr
am-is-stopped

This is mostly relevant to csight, but can also be important in 
synoptic/perfume/invarimint, all of which use an external graphviz child 
process to generate models (which may take a long time).

Original issue reported on code.google.com by bestchai on 13 Aug 2014 at 2:12