由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - java & signal process
相关主题
java signal process请教个JAVA的小问题
HELP:这个死锁是怎么发生的?Malab里调用第三方的java class,总是不成功。
C signal SIGFPE 问题说起内存管理,记得bjarne讲的一个八卦
最近用vert.x解决了一个实际问题java的内存管理真是气死我了
不用jvm也没啥,问题在于你有其他替代品么?求教有没有好的查Java memory leak的工具? (转载)
前端码农想转后端的困惑,望大牛解答interview question: what is the difference between Java and c++
问问跟Linux Kernel Programming 有关的问题C++现在前进的方向是不是错误的?
对L股价大跌的一点看法 (转载)Oralce Java VS Android VS FLEXAIR + AJAX
相关话题的讨论汇总
话题: signal话题: java话题: process话题: response话题: command
进入Programming版参与讨论
1 (共1页)
x******o
发帖数: 31
1
let's say that i have one process running at backend
(it is a java program like start from command line by:
java -cp ... MyJava.class) and suppose this process id is 101.
now, i send the signal from command line (on unix):
kill -9 101
how can i let MyJava.class response to -9 signal?
I think that JVM will take -9 signal at first and there is no ways for
MyJava.class to response -9 signal in this case.
So is there any other way for java program (like MyJava.class) to response
signal?
Thanks.
t****t
发帖数: 6806
2
you can never trap signal 9 (SIGKILL), even without java.
neither can you trap SIGSTOP.

【在 x******o 的大作中提到】
: let's say that i have one process running at backend
: (it is a java program like start from command line by:
: java -cp ... MyJava.class) and suppose this process id is 101.
: now, i send the signal from command line (on unix):
: kill -9 101
: how can i let MyJava.class response to -9 signal?
: I think that JVM will take -9 signal at first and there is no ways for
: MyJava.class to response -9 signal in this case.
: So is there any other way for java program (like MyJava.class) to response
: signal?

X****r
发帖数: 3557
3
Besides what thrust has said, since signal is a POSIX things while Java
is supposed to be platform-independent, by definition there should be no
standard way to handle signals in Java. A Google search should tell you
all these non-standard ways, e.g. sun.misc.SignalHandler , depends on
the Java VM you're using.

【在 x******o 的大作中提到】
: let's say that i have one process running at backend
: (it is a java program like start from command line by:
: java -cp ... MyJava.class) and suppose this process id is 101.
: now, i send the signal from command line (on unix):
: kill -9 101
: how can i let MyJava.class response to -9 signal?
: I think that JVM will take -9 signal at first and there is no ways for
: MyJava.class to response -9 signal in this case.
: So is there any other way for java program (like MyJava.class) to response
: signal?

r*********r
发帖数: 3195
4
windows 上难道没有这个东西?
搞得连 boost 都没有 signal handling 好像。
t****t
发帖数: 6806
5
windows好象没signal
cygwin是用一个单独的线程来等"信号"事件的(真TMD浪费)
1 (共1页)
进入Programming版参与讨论
相关主题
Oralce Java VS Android VS FLEXAIR + AJAX不用jvm也没啥,问题在于你有其他替代品么?
古狗研究新出炉:C++ Is The Best Performing Language前端码农想转后端的困惑,望大牛解答
有哪些公司用Lisp开发程序问问跟Linux Kernel Programming 有关的问题
震惊:java 的矩阵操作比 c++ 快?对L股价大跌的一点看法 (转载)
java signal process请教个JAVA的小问题
HELP:这个死锁是怎么发生的?Malab里调用第三方的java class,总是不成功。
C signal SIGFPE 问题说起内存管理,记得bjarne讲的一个八卦
最近用vert.x解决了一个实际问题java的内存管理真是气死我了
相关话题的讨论汇总
话题: signal话题: java话题: process话题: response话题: command