多线程
文章平均质量分 82
不可不戒
这个作者很懒,什么都没留下…
展开
-
Art of Multiprocessor Programming 答案 ch8 p97
public class Rooms { private Lock lock; private Condition[] conditions; private int[] waits; private int[] acquire; private int[] leave; private Handler[] handlers; priv原创 2015-05-06 12:10:54 · 1201 阅读 · 0 评论 -
Art of Multiprocessor Programming 答案 ch8 p93
public interface Lock { void lock(); void unlock();}public interface ReadWriteLock { Lock readLock(); Lock writeLock();}public class SimpleReadWriteLock implements ReadWriteLo原创 2015-05-06 11:49:43 · 866 阅读 · 0 评论 -
Art of Multiprocessor Programming 答案 ch8 p95
public class Account { /**优先存款方式*/ private static final int PREFER = 1; /**普通存款方式*/ private static final int NORMAL = 2; private int surplus;//结余 private int preferRequests;原创 2015-05-06 12:05:29 · 1175 阅读 · 0 评论 -
Art of Multiprocessor Programming 答案 ch8 p96
public class Bathroom_Lock { private int maleAcq; private int maleRel; private int femaleAcq; private int femaleRel; private int maleWait; private int femaleWait; private原创 2015-05-06 11:58:46 · 1000 阅读 · 0 评论 -
用三个线程控制循环输出10次ABC
public class PrintABC_Syn { private static final int MAXN = 30; private int count = 0; private char currThreadName = 'A'; private final Object lockObj; public PrintABC_Syn(){原创 2015-05-06 11:18:48 · 1948 阅读 · 0 评论