Java中的中断处理 [英] Interrupt handling in Java

查看:82
本文介绍了Java中的中断处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何使用Core Java与系统调用,操作系统中断进行交互.


预先比thanx

Hi,

How to interact with System calls, Interrupt of Operating system by using Core Java.


thanx in advance

推荐答案

没有从Java到OS的通用接口.该应用程序在JVM中运行,您直接拥有的唯一访问权是通过诸如java.lang.System之类的类,该类提供了与操作系统的挂钩.

对于您想捕获I/O中断的任何特定情况,我认为最好的方法是在C ++中创建一个更高级别的接口,然后加载该JVM来访问它.但是,如果您不妨考虑一下自己的要求,可能会发现,有一个更高层次且更容易实现目标的方法.

您是否真的需要知道何时发生低级中断,还是只听鼠标,文件系统或键盘?
There is no generic interface into the OS from Java. The application is running within the a JVM and the only access you have directly is through classes like java.lang.System which provides hooks into the OS.

For any specific case where you want to catch I/O interrupts, I think the best but would be to create a higher level interface in C++ and then load that the JVM to access it. However you may well find, if you bother to think about your requirements, that there is a higher level and easier way to achieve your goal.

Do you really need to know when low level interupts fire or can you just listen for the mouse, file system or keyboard?


这篇关于Java中的中断处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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