-
java 多线程基础之二:线程的中断(interrupt)
这篇博客记录怎么中断一个线程(interrupting a thread)有时候,我们需要结束一个线程,因为你想终止程序,或者你想取消某个任务,而这个任务是在线程中执行的。java 提供了 interruption 机制,在我们需要强制结束一个线程的时候使用.但在使用的时候,有一点是需要注意的,那就是要检查这个线程是否被 interrupted, 然后决定是否结束相应请求,或者忽略继续执行其他的
Date: 2013-01-19 View: 1520
-
java 多线程基础之一:多线程创建,执行,状态管理
这几天在看一本书:<Java 7 Concurrency Cookbook> 因为是纯英文版,平时也很少有时间专门去看,快到年底了,没心情做事,所以看看,顺便复习下多线程编程所以,就记录下来
Date: 2013-01-17 View: 1520
-
Spring Batch Partitioning example
Photo Credit : Spring Source
Date: 2019-08-18 View: 1520
-
Java Thread Mutex and Semaphore example
Java multi threads example to show you how to use Semaphore and Mutex to limit the number of threads to access resources.
Date: 2019-08-11 View: 1520
-
Java ExecutorService examples
In Java, we can use ExecutorService to create a thread pool, and tracks the progress of the asynchronous tasks with Future.
Date: 2019-08-11 View: 1520
-
Java Semaphore examples
In Java, we can use Semaphore to limit the number of threads to access a certain resource.
Date: 2019-08-11 View: 1520
-
Java BlockingQueue examples
In Java, we can use BlockingQueue to create a queue which shared by both producer and the consumer.
Date: 2019-08-11 View: 1520
-
Java ProcessBuilder examples
In Java, we can use ProcessBuilder to call external commands easily :
Date: 2019-08-11 View: 1520