摘要: 用ManulResetEvent实现生产者消费者,声明了两个ManulResetEvent类型变量,其实用一个也可以。现在用AutoResetEvent实现。Auto和Manual的区别是Auto只唤醒一个线程,Manual是唤醒所有。 public class AreTest ... 阅读全文
posted @ 2015-06-28 18:48 nbu_djw 阅读(178) 评论(0) 推荐(0) 编辑
摘要: public class MreTest1 { public static ManualResetEvent mre = new ManualResetEvent(false); public static void Add() ... 阅读全文
posted @ 2015-06-28 17:18 nbu_djw 阅读(163) 评论(0) 推荐(0) 编辑
摘要: private static Mutex m = new Mutex(); static bool p = true; public static void A() { while (true) { ... 阅读全文
posted @ 2015-06-28 14:13 nbu_djw 阅读(131) 评论(0) 推荐(0) 编辑