当我的程序应该完成时,某些方法仍在运行...我如何找到? [英] Some method still running when my program should be finished... how do I find out?

查看:80
本文介绍了当我的程序应该完成时,某些方法仍在运行...我如何找到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完成后我的程序仍在运行。我在main的末尾输出了文本,所以我知道它到达那里就好了,程序完成了一切就好......但是jvm仍在运行。我如何找到它仍在运行的位置,这样我至少可以知道具体问题是什么?任何特别的节目或想法?


谢谢,


-blazed

My program is still running when I am finished. I outputted text at the end of the main, so I know it gets there just fine and the program finished everything just fine... but the jvm is still running. How do I find out where it''s still running so I can at least know specifically what''s the problem? Any special programs or ideas?

Thanks,

-blazed

推荐答案

您必须在程序中的某个位置启动线程。在启动它们之前制作那些

个线程的'守护程序线程'(查看API文档)。

当主线程死掉时,守护程序线程会死掉,因此JVM将停止(它还有

无处可做。)


亲切的问候,


Jos
You must have started threads then somewhere in your program. Make those
threads ''daemon threads'' (check the API documentation) before you start them.
Daemon threads die when the main thread dies so the JVM will stop (it has
nothing more to do).

kind regards,

Jos



您必须在程序中的某个位置启动线程。在启动它们之前制作那些

个线程的'守护程序线程'(查看API文档)。

当主线程死掉时,守护程序线程会死掉,因此JVM将停止(它还有

无处可做。)


亲切的问候,


Jos
You must have started threads then somewhere in your program. Make those
threads ''daemon threads'' (check the API documentation) before you start them.
Daemon threads die when the main thread dies so the JVM will stop (it has
nothing more to do).

kind regards,

Jos



对不起,不幸的是我有0次线程经验。我查看了守护程序线程,但老实说,我不是在程序的任何地方开始新的线程。我也检查并关闭了所有流,我不知道这是什么,真的。


我在类线程API中找到了这个:


"当Java虚拟机启动时,通常会有一个非守护程序线程(通常调用名为main的某个指定类的方法)。


我可以尝试从另一个程序中调用这个类(我打算不管怎么做),而不是使用自己的主程序......但我想知道是否会继续在后台运行。


我知道线程,并且很清楚它们是什么以及它们是如何工作的。我想知道我正在调用的方法是否创建线程(SAX?)。我曾经使用sax一段时间之前从未遇到过这个问题...


感谢您的帮助,


-blazed

I''m sorry, but unfortunately I have 0 experience with threads. I looked into daemon threads, but honestly, I''m not starting a new thread anywhere in the program. I also checked and closed all streams, I don''t know what this could be, really.

I did find this in the class thread API:

"When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class)."

I could try to call this class from another program (which I''m planning on doing anyway) instead of using its own main... but I wonder if something will continue to run in the background.

I know of threads, and a fairly good idea of what they are and how they work. I''m wondering if whatever methods I''m calling create threads (SAX ? ). I''ve been using sax for a while though and never had this problem before...

Thanks for all your help,

-blazed



对不起,不幸的是我有0次线程经验。我查看了守护程序线程,但老实说,我不是在程序的任何地方开始新的线程。我也检查并关闭了所有流,我不知道这是什么,真的。


我在类线程API中找到了这个:


"当Java虚拟机启动时,通常会有一个非守护程序线程(通常调用名为main的某个指定类的方法)。


我可以尝试从另一个程序中调用这个类(我打算不管怎么做),而不是使用自己的主程序......但我想知道是否会继续在后台运行。


我知道线程,并且很清楚它们是什么以及它们是如何工作的。我想知道我正在调用的方法是否创建线程(SAX?)。我曾经使用sax一段时间之前从未遇到过这个问题...


感谢您的帮助,


-blazed
I''m sorry, but unfortunately I have 0 experience with threads. I looked into daemon threads, but honestly, I''m not starting a new thread anywhere in the program. I also checked and closed all streams, I don''t know what this could be, really.

I did find this in the class thread API:

"When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class)."

I could try to call this class from another program (which I''m planning on doing anyway) instead of using its own main... but I wonder if something will continue to run in the background.

I know of threads, and a fairly good idea of what they are and how they work. I''m wondering if whatever methods I''m calling create threads (SAX ? ). I''ve been using sax for a while though and never had this problem before...

Thanks for all your help,

-blazed



我可以知道

1.)你的程序做什么

2.)你如何确定程序退出后JVM仍在运行

May I know
1.) What your program does
2.) How you determined that the JVM is still running after your program has exited


这篇关于当我的程序应该完成时,某些方法仍在运行...我如何找到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆