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 以苦為樂 閱讀(350) | 評論 (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 以苦為樂 閱讀(151) | 評論 (0)編輯 收藏

          僅列出標題  
          主站蜘蛛池模板: 会泽县| 垣曲县| 永清县| 南城县| 富源县| 隆化县| 永泰县| 巴东县| 三原县| 凤冈县| 新田县| 蕲春县| 湖北省| 平远县| 商城县| 大埔县| 潜江市| 曲周县| 太谷县| 靖远县| 西峡县| 应用必备| 巴青县| 肇东市| 福泉市| 北票市| 米易县| 介休市| 池州市| 汉川市| 类乌齐县| 阿克| 奉新县| 渝中区| 澎湖县| 吉安县| 临颍县| 浦县| 永顺县| 湘阴县| 石台县|