java Thread
文章平均质量分 72
EthanQ
这个作者很懒,什么都没留下…
展开
-
Thread.sleep小感
package com.ethan.kongzhong;public class Test1 implements Runnable { private Integer monitor = 0; // private int i =0; publi原创 2011-08-25 14:29:21 · 1677 阅读 · 0 评论 -
java 之 读写锁 线程间互斥
import java.util.Random;import java.util.concurrent.locks.ReadWriteLock;import java.util.concurrent.locks.ReentrantReadWriteLock;/** * 线程间互斥 * @author ETHAN * */public class ReadWriteLockTest原创 2012-03-21 19:45:05 · 1900 阅读 · 0 评论 -
java 之 Condition 线程间通信
import java.util.concurrent.locks.Condition;import java.util.concurrent.locks.Lock;import java.util.concurrent.locks.ReentrantLock;public class ConditionCommunicationTest { public static void m原创 2012-03-22 00:00:50 · 854 阅读 · 0 评论 -
java 之 阻塞队列实现
import java.util.concurrent.locks.Condition;import java.util.concurrent.locks.Lock;import java.util.concurrent.locks.ReentrantLock;/** * 阻塞队列 * @author ETHAN * */public class BoundedBuffer {原创 2012-03-22 00:00:08 · 947 阅读 · 0 评论 -
java 之 Lock 同步锁学习示例
import java.util.concurrent.locks.Lock;import java.util.concurrent.locks.ReentrantLock;public class LockTest { /** * @param args */ public static void main(String[] args) { init(); }原创 2012-03-21 16:37:20 · 1264 阅读 · 0 评论 -
java 之 Callable 与 Future 的应用
import java.util.concurrent.Callable;import java.util.concurrent.CompletionService;import java.util.concurrent.ExecutionException;import java.util.concurrent.ExecutorCompletionService;import java.原创 2012-03-21 15:54:18 · 1309 阅读 · 0 评论 -
java 之 线程池学习
import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.TimeUnit;public class ThreadPoolTest { /** * @param args */ public static void原创 2012-03-21 15:09:39 · 559 阅读 · 0 评论 -
java 之 多线程Runnable 示例
import java.awt.BorderLayout;import java.awt.HeadlessException;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextArea;import javax.swing.border.BevelBorder;import java原创 2012-02-20 14:14:14 · 3013 阅读 · 0 评论 -
java 之 停止多线程示例
import java.awt.BorderLayout;import java.awt.EventQueue;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.原创 2012-02-20 14:16:21 · 1148 阅读 · 0 评论 -
java 之 三个线程交替执行任务
import java.util.concurrent.locks.Condition;import java.util.concurrent.locks.Lock;import java.util.concurrent.locks.ReentrantLock;/** * Condition实现线程间通信 * @author ETHAN * */public class Thre原创 2012-03-22 00:02:13 · 5322 阅读 · 1 评论