From: James F. <ja...@we...> - 2002-10-16 00:56:44
|
Okay correct me if I'm wrong: Jython is java code that runs on the JVM in thread A, using awt will = cause a second thread B to be started. Ctrl + Z and Enter causes thread = A to return from its run() method which would generally cause the JVM to = exit but since thread B is still running it doesn't. My first question would be why isn't the AWT thread a daemon thread? It = only exists for the use of other threads and if they've all exited it = isn't going to achieve anything but will stop the JVM from exiting. I = know this has got nothing to do with Jython but I'm curious to see if = there is a good reason for this. Now I understand that System.exit() would kill all threads and exit the = JVM so I guess that I could close jython using a System.exit() call. = Alternatively the jython interpreter could explicitly exit. This would = seem to be consistent with what you would expect the interpreter to do = when you close it, rather than leaving threads running. Is there any = downside to having the interpreter exit explicitly? Regards, James. > -----Original Message----- > From: Jeff Emanuel [mailto:je...@ad...] > Sent: Friday, October 11, 2002 1:03 PM > To: James Ferguson; jyt...@li... > Subject: Re: [Jython-users] Command-line interpreter bug. >=20 >=20 >=20 > You can see from the documentation of java.lang.Thread > that the JVM exits when all non-daemon threads have > died. When displaying a frame, AWT starts a non-daemon thread > to handle GUI events. That AWT thread is one that causes your > command line to hang after you kill the main thread. >=20 > http://java.sun.com/j2se/1.4/docs/api/java/lang/Thread.html >=20 |