barrybao

          2006年4月17日 #

          Thread.wait

          Today, I tried to wirte some code to test thread. Use a Schedular to controll thread's running. For thread: public class ControllerThread extends Thread { public void run() { ... Schedular.waitForOthers(this); ... } } In Schedular public class Schedular { public static synchronized void waitForOthers(ControllerThread thread) throws InterruptedException { waitingThreadNum++; // waitingThreadNum is a counter. if (waitingThreadNum != threads.size()) { System.out.println("Thread:" + thread.getName() + " is going to wait"); wait(); // thread.wait() is useless here } else { waitingThreadNum = 0; System.out.println("All threads will run"); notifyAll(); } } } Is there anybody know why thread.wait cannot work in Schedular?

          posted @ 2006-04-17 23:44 以苦為樂 閱讀(349) | 評論 (0)編輯 收藏

          2006年4月16日 #

          New Start

          It is very hard for me to start a blog.
          Firstly it is I'm lack of permanence. My interests are always chaging, I cannot focus on one thing for a long time, especially in network. Once I have a blog in campus bbs, but I spent so little time on it that there are only two senseless articles.
          Secondly my work time is very long. I have to work from 8:30a.m to nearly 9:00p.m?everyday. Duration this time, it is forbidden to access blog. So I don't?think that I can pay too much attention on my own area.?
          When I work on protype type for next project these days, I?try hard to avoid old detects that appear in the previous prooject.??Unfortunately, I only know what is bad, which is not enough.?Though I have thought much, the design is not satisfied. Some workmates said?it is only my dream.
          I look for the answers in the?net, and find some good ideas. At this time , I appreciate others' knowledge sharing. And I think I also need to share my exceprience and discuss with others.
          So I?start this blog. Hope it is a new start.

          posted @ 2006-04-16 23:57 以苦為樂 閱讀(150) | 評論 (0)編輯 收藏

          僅列出標題  
          主站蜘蛛池模板: 秦皇岛市| 富川| 师宗县| 泊头市| 页游| 福泉市| 波密县| 横峰县| 华亭县| 惠来县| 册亨县| 芮城县| 泗阳县| 海阳市| 九江县| 莆田市| 南汇区| 郎溪县| 鹤岗市| 丰宁| 紫云| 祥云县| 汉寿县| 井冈山市| 张家口市| 车险| 东源县| 西华县| 伊春市| 陆河县| 张家口市| 桂阳县| 临西县| 宾川县| 金溪县| 资兴市| 揭阳市| 九龙县| 瑞丽市| 马尔康县| 旺苍县|