On Mon, 31 May 1999, Ken McNeil wrote:

> --- Christopher Seawood <[EMAIL PROTECTED]> wrote:
> > 
> > I'm using the 1.2pre1 release on a RH6.0 system.  I
> > started developing
> > this app that uses Swing under NT using Java
> > Workshop 3.0 with Sun's 1.2
> > release. I tried running the app under Linux and it
> > immediately exits.  I
> > don't explicitly create any threads in main() (just
> > the main window) and
> > the program exits when main() does.  Obviously, this
> > isn't the behavior
> > under NT.  Am I hitting some
> > implementation-dependent feature of Java or
> > is one of the versions not adhering to the spec?

I think you have that backwards. The VM should exit
when System.exit() is called or when there are no more
non-damon threads (if there is a non-daemon, don't exit).
The GUI thread should be a non-daemon thread in that
case. So if you create only daemon threads and you
do not create GUI widgets then your program would exit
when main() is finished.

later
mo dejong

> The rule is that the VM exits when there are no more
> dameon threads running or the user calls
> System.exit(int). The GUI thread is a dameon so if you
> are running a GUI app the program will not exit at the
> end of main (main starts dameon a thread that exits
> when main does). So if you program starts no other
> dameon threads and it exits at the end of main this
> correct behavior.
> 
> Ken
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
> 


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to