harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: [drlvm][shutdown] How to cleanup resources safely?
Date Tue, 21 Nov 2006 14:41:36 GMT


Tim Ellison wrote:
> Geir Magnusson Jr. wrote:
>> So VMs aren't embeddable.
> 
> How so?  *Any* thread in an app can potentially call an OS's exit() and
> bring down the app, so why are you distinguishing the thread that
> happens to be running Java code?

Becuase I'm reading the spec which says that System.exit() exits the VM, 
not the process, but the behavior is that current impls kill the process.

> 
>> <sigh>
>>
>> Maybe we can offer a flag for people that want to truly embed the VM...
> 
> If you don't want the Java app to call System.exit() then you can set up
> a security manager to prevent it.  It will then be required to unwind
> nicely to get out, and the VM will terminate when there are no
> non-daemon threads etc etc.


But there's nothing wrong with System.exit() just killing the VM.  So 
sure, you can revoke the exitVM perm, but also in the event when you 
want it to happen, I think there's nothing wrong with letting it, and 
just having the VM exit.

geir


Mime
View raw message