发明名称 System and method for handling threads of execution
摘要 A mechanism for controlling threads in a Java application while avoiding the unsafe conditions inherent in the use of existing java.lang.Thread methods. In one embodiment, a first class is defined for handling threads in an application. The first class uses a target variable to indicate whether a thread should continue to run, or whether it should be stopped. This first class provides a start( ) method to set up the target variable, a stop( ) method to set the target variable to indicate that the thread should be stopped, and an abstract run( ) method. The functionality of the run( ) method is provided by one or more additional classes which extend the first class. The additional classes override the abstract run( ) method and define the tasks to be performed by threaded objects instantiated from these classes. When a thread needs to be stopped, the corresponding target variable is set to indicate that it should be stopped. The thread periodically checks the target variable and, when the target variable is set to indicate that the thread should be stopped, the thread executes one or more instructions that cause execution of the thread to complete and to exit normally.
申请公布号 US6711739(B1) 申请公布日期 2004.03.23
申请号 US19990436792 申请日期 1999.11.08
申请人 SUN MICROSYSTEMS, INC. 发明人 KUTCHER JEFFREY M.
分类号 G06F9/00;G06F9/44;G06F9/48;G06F17/00;(IPC1-7):G06F17/00 主分类号 G06F9/00
代理机构 代理人
主权项
地址