barrybao

          2006年4月16日 #

          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)編輯 收藏

          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)編輯 收藏

          主站蜘蛛池模板: 靖宇县| 灵石县| 合水县| 什邡市| 小金县| 江阴市| 岱山县| 麻城市| 酉阳| 霸州市| 兴文县| 会东县| 靖远县| 宜黄县| 乐陵市| 宾阳县| 鲁山县| 宁乡县| 兖州市| 抚顺县| 乾安县| 武定县| 宁远县| 高阳县| 突泉县| 洪雅县| 手机| 四会市| 北宁市| 合川市| 浮山县| 肥城市| 新营市| 菏泽市| 宾阳县| 杂多县| 大连市| 郯城县| 钟祥市| 三穗县| 江城|