- 浏览: 127241 次
- 性别:
- 来自: Singapore
文章分类
- 全部博客 (112)
- Tiger Thread (18)
- Perforce (6)
- Spring (5)
- maven (3)
- log4j (3)
- Quartz Scheduler (4)
- unix and linux (12)
- hibernate (3)
- Enum (1)
- Futures and Options (1)
- Market Making (2)
- Java Basic (11)
- Tibco EMS (3)
- F I X message (5)
- equity derivative (2)
- Sybase (3)
- XML (1)
- JUnit (2)
- J A X B 2.0 (1)
- N I O (1)
- windows batch file (1)
- Cruise Control (1)
- util Class (5)
- ant (1)
- JMS (1)
- profiling (0)
- Sql Server (6)
- GXT (2)
- eclipse (1)
- Generics (1)
- Tibco RV (3)
- Autosys (0)
- Message (1)
最新评论
-
houzhe11:
<property name="proxyTa ...
AOP usage -- BeanNameAutoProxyCreator usage
1) Each thread has a boolean interrupted status.
2) 3 interrupt related methods defined in Thread class
public class Thread
{
public void interrupt() {...} // interrupts the target thread
public boolean isInterrupted() {...} //return the interrupted status of the target thread.
//clear the interrupted status of the current thread, and returns its previous value.
//This is the 1st way to clear the interrupted status
public static boolean interrupted() {...}
}
3) Another way the clear the interrupted status is:
When the thread is in blocked status, if you call interrupt() on it, the thread will automatically go to Catch(InterruptedException e){...} block. As soon as the exception is thrown out, the interrupted status will be cleared.
4) interrupt() method acutally does just one thing --- set interrupted status to true. Nothing else. From this point of view, it only makes sense when the thread is monitoring the interrupted status.
The thread will monitor the interrupted status only under 1 situation --- the thread is in blocked status which is wrapped with catch(InterruptedException e){}
1) thread.sleeping()
2) object.waiting()
3) BlockedQueue operations
4) Lock.lockInteruptibly()
What I want to say is, very likely, interrupt() method doesn't work for some thread, it means those threads are not interruptable.
So, just one sentence to summary,
If the current line of code is monitored by InterruptedException, then, if you interrupt it at the time or before that, it will work. Otherwise, just everthing in vain---setting interrupted status to true means nothing!
发表评论
-
javadoc for Cyclic Barrier
2009-04-24 12:48 907java.util.concurrent.CyclicBarr ... -
Delayed interface and Delay Queue
2009-04-22 17:42 1054/** * A standard implementati ... -
Count Down Latch example code
2009-04-22 10:38 1155Key point : 1) 1 task is co ... -
3 ways to break dead lock
2009-04-21 17:30 7661) supply special resources. ... -
Blocking Queue Usage
2009-04-20 11:21 8343 implementations: LinkedBlocki ... -
The usage of Lock and Condition
2009-04-18 12:31 1070//: concurrency/waxomatic2/WaxO ... -
Re entrantLock usage
2009-04-15 17:15 1321a thread can be really interru ... -
new interrupt in java5
2009-04-15 12:08 660In Java 5, Thread.interrupt() i ... -
Executor Service Usage
2009-04-14 18:18 894ExecutorService exec = Executor ... -
Thread Local usage
2009-04-14 17:46 817ThreadLocal usage – from Javado ... -
Timer TimerTask usage
2009-04-14 12:03 725Timer typical usage new Tim ... -
wait, notify及线程通讯机制
2009-02-26 22:42 8511) wait(), notify() 方法被调用的时候,只要 ... -
Java Thread programming basical knowledge
2009-02-26 22:40 1090yield() : Give a hint to the th ... -
Count Down Latch explanation
2008-10-02 10:29 959Very important paragraph on how ... -
Scheduled Executor Service
2008-07-22 11:27 1110Executor can return Executor, E ... -
Executor usage
2008-07-22 11:04 909Executor is used to arrange thr ... -
Callable Usage
2008-07-22 10:24 935The important thing need to loo ...
相关推荐
在嵌入式系统开发中,中断(Interrupt)是硬件与软件之间进行通信的重要机制,它使得微控制器能够及时响应外部事件,而无需持续轮询。本文将深入探讨使用MPLABX集成开发环境和XC8编译器进行中断处理的例子。 标题...
### 解释 void timer0() interrupt 1 using 2 在探讨`void timer0() interrupt 1 using 2`这一表达式之前,我们首先需要理解它所处的上下文——80C51单片机系统及其编程环境。80C51是一款广泛应用于嵌入式系统的微...
在IT领域,"com interrupt void interrupt 4 using 3" 这个描述涉及到的是中断服务子程序(Interrupt Service Routine, ISR),这是在微处理器系统中处理外部硬件事件的一种机制。这里的“com”可能指的是串行通信...
### ARM Generic Interrupt Controller (GIC) Architecture Specification #### 概述 ARM Generic Interrupt Controller (GIC) 是一种中断控制器架构规范,旨在为基于ARM架构的操作系统提供通用且灵活的中断管理...
早期的PC系统采用传统的可编程中断控制器(PIC, Programmable Interrupt Controller)来管理中断请求。在最初的IBM PC设计中,有两个8259A PIC芯片共同工作,负责处理中断请求。 - **主PIC**: 负责管理IRQ0至IRQ7共8...
### Polyspace与中断处理:让Polyspace认识Interrupt #### 一、引言 在嵌入式系统开发过程中,中断处理是不可或缺的一部分。中断可以让系统在特定条件下响应外部事件,从而实现高效的实时处理能力。然而,在进行...
《Ralf Brown's Interrupt List》是计算机领域内一本非常重要的参考资源,主要涵盖了微处理器和其他硬件设备中断的详细信息。这个列表由Ralf Brown维护,是程序员、系统工程师和硬件爱好者在处理中断相关问题时不可...
处理器响应中断后,会保存当前任务的状态,跳转到预先定义的中断服务程序(ISR,Interrupt Service Routine)执行相应的操作,处理完事件后再恢复先前的任务,这就是中断的上下文切换。 在基于DSP的系统中,中断...
文档首先介绍了在nRF51822中引入的Task和Event机制,以及它们与Interrupt(中断)的关系。接着详细阐述了中断的概念、中断的触发机制、中断源代码的编写、以及如何通过代码样例来实现中断接收。以下详细解释了文档中...
文档提供了ARM® Generic Interrupt Controller的架构规范,介绍了GIC架构3.0和4.0版本的详细信息,其中包含了一些在先前版本2.0中已经发布的资料。此外,文档还涉及到版权和知识产权的声明,明确指出该文档受版权...
《Ralf Brown's Interrupt List》是DOS操作系统中不可或缺的一个技术资源,由Ralf Brown编纂,详尽地列举了DOS以及IBM PC兼容机上的中断服务,包括BIOS(基本输入输出系统)和DOS中断。这个列表是程序员、系统开发者...
程序名称:interrupt.asm 程序说明:74HC595驱动数码管动态显示例,通过按键触发外部中断,P3.2进行计数,P3.3清零,实验箱上完成 算法说明:由两片74HC595芯片分别驱动段和位,数码管动态扫描显示:修改延时子...
Detection of Excessive Interrupt Disablement - a new feature which can detect a period of excessive interrupt disablement on a CPU, and create an error log record to report it. This allows you to know...
ARM Generic Interrupt Controller (ARM GIC控制器)V2.0 ARM Generic Interrupt Controller (ARM GIC控制器)是ARM公司推出的一个通用中断控制器架构规范,用于实现高效的中断处理。该规范旨在提供一个灵活的中断...
《Arm CoreLink GIC-600 Generic Interrupt Controller 技术参考手册》是关于ARMv8架构下中断控制器GIC-600的详细指南,由ARM Limited或其关联公司版权所有。该手册覆盖了从r1p6版本的多个发布迭代,提供了控制器的...
在计算机科学领域,中断服务程序(Interrupt Service Routines, ISR)是一种特殊类型的程序,它们被设计用于处理来自硬件设备的中断请求。这些请求可能由外部事件触发,如键盘按键、定时器超时或磁盘读写完成等。在...
The Generic Interrupt Controller (GIC) architecture defines: • the architectural requirements for handling all interrupt sources for any processor connected to a GIC • a common interrupt controller ...
微机接口课程实验interrupt.asm
### Open Firmware Recommended Practice: Interrupt Mapping 版本 0.9 #### 1. 概述与背景 在计算机系统中,中断(Interrupt)是硬件设备与操作系统之间进行通信的重要方式之一。当一个设备需要处理紧急任务时,...