????1??????????
?????????????????????????????С??λ?????????????????У???????е??????????λ???????????????????ж???????????????????????????????????????????磬????????????????????100??????????????????????????10????Java?????????????????????????????????????????
????2?????????????????
?????????????????????????????к?????????????????в??????????????????ò??????????????е?????????????????????????????????????????е??????????????洢?????????
????3???????Java?????????
???????????????????????java.lang.Thread ??????????????????????????java.lang.Runnable???????У??????????????????Runnable??????????????java.lang.Thread ???????????Runnable???????дrun()???????????
????4????Runnable????Thread??
???????????????????????????????????????????Thread????????Runnable?????????????????????????????????????????????????????????????????????Java????????????У?????????????????????????????????????????????Runnable???????
????5??Thread ???е?start() ?? run() ????????????
??????????????????????????????????????????Java?????????????start()??????????????′?????????????start()?????????run()???????????????run()??????Ч????????????????run()?????????????????????????е????????μ?????????start()????????????????
????6??Java??Runnable??Callable?????????
????Runnable??Callable????????Щ??????????????е?????Runnable??JDK1.0????????Callable????JDK1.5????????????????????Callable?? call() ???????????????????????Runnable??run()?????????Щ?????Callable???????????м???????Future????
????7??Java??CyclicBarrier ?? CountDownLatch?????????
????CyclicBarrier ?? CountDownLatch ?????????????????????????????? CyclicBarrier ????????CountdownLatch ??????????á?
????8??Java????????????
????Java??????漲?????Java?????????????????CPU?????????????????????????????????????????????Java????????????????????????????????????????????????????з?????????????????????Щ?????ó??????????????·???????????磬???з????????????
??????????????????????????У??????????????????????????????????????????????????????????????????????????????????????????????????volatile??д??????????volatile??????????????volatile??????????????????κβ????????????????start()????????????????????????????????в??????????????????????????????????????????????????????????????????ж???????????????? 10??Java?е?volatile ??????????
????volatile?????????????η?????г???????????????????Java?????????????????????£???????????????????????????????????volatile??????????????????????????????д???????????????????volatile????????
????11?????????????Vector??????????????
????????????????????????ж????????????У?????Щ???????????????δ????????????н???????????е???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????飬????????????????Vector ???????????????????????? ???????????ArrayList????????????
????12??Java?????????????? ????????????
??????????????3????????????3????Щbugs?????????Щ????????????????????????????????????е??????????????????????????????????????Щ???????bugs??????bugs????????????????????????????????????????????????????
????13??Java??????????????
????Java????????API?????????????API??JDK 1.0???????Щ??stop()?? suspend() ?? resume()??????????????????????????в??????????JDK?汾?????????????????Java API????????????????????????????????????????????run() ???? call() ???????????????????????????????????????????????????volatile ?????????????run()?????????????????????????ж?????
????14???????????????????????????
????????????????????????????????????Java?????? ??????????????б????????????????С?Thread.UncaughtExceptionHandler?????????δ???????????????ж?????????????????????δ???????????????ж?????JVM?????Thread.getUncaughtExceptionHandler()?????????UncaughtExceptionHandler??????????????????????handler??uncaughtException()???????д????
????15??????????????乲???????
??????????????????????????????????????????????????????????????????????????Java????????(?漰???????????乲?????)??wait??notify?????????????????????????
????16??Java??notify ?? notifyAll????????
????????????????????????????????????????????Java API ?????????????Щ?????????????????????????????????Щ??????????????notify()?????????????????????????????????????????????????????????????notifyAll()???????????????????????????????????????????????????С?
????17?????wait?? notify ?? notifyAll??Щ????????thread?????棿
?????????????????????????????????????????????Щ???????????????????????????????????Щ?????????????????????Щ????????Object?????????????????в?????????Thread???????????????????????JAVA?????????????????????????????????????????????á??????????????Щ?????????????е?wait()????????????????wait()??????????Thread???У???????????????????????????????????????wait??notify??notifyAll??????????????????????????????Object????????????????
????18??????ThreadLocal??????
????ThreadLocal??Java???????????????????????????ThreadLocal??????????????????????????????????????????????????????????????????????????????????÷????????????????ThreadLocal??SimpleDateFormat???????????????????????????????ε?????????????????????????????????Χ????????????????????????????е??????????????????Ч??????????????ü???????????????????????????Σ????????????????????????????????????????????????????????????????????????ThreadLocalRandom??????????????м????????????????Random??????????
????19??????FutureTask??
??????Java??????????FutureTask?????????????????????????????????????????????????????????????????????е???????????????????????????????δ???get?????????????????FutureTask?????????????Callable??Runnable???????а????????FutureTask????????Runnable?????????????????Executor????С?
????20??Java??interrupted ?? isInterruptedd??????????
????interrupted() ?? isInterrupted()????????????????ж???????????????Java???????ж?????????????????????????Thread.interrupt()???ж?????????????ж????true?????ж??????t??????Thread.interrupted()??????ж???????ж???????????????????isInterrupted()????????????????ж???????????ж????????????????κ????InterruptedException????????????ж?????????????Σ?????????ж??????п???????????????ж??????
????21?????wait??notify?????????????е????
????????????Java API????????????????????????????????????IllegalMonitorStateException??????????????????????wait??notify???????????????
????22????????????????м?????????
????????????????????????????????α????????????????м??????????????????????????????????????????????????????????????????????????????????????????Ч?????notify()????????????????????????????????????????????????????wait()????Ч?????????????????Eclipse?д?????????wait??notify???????????????????????????????????????????????Effective Java???????е????????????
????23??Java?е????????????????????????
??????????????????????????????????????????????????????????????????????????Java1.5????????????????????????????????????????????????譚????????????Java5???????????????ConcurrentHashMap???????????????????????????????????????????????????????????????????
????24??Java?ж????????????
?????????????????????????????????????????????????????????????????????????????????棬????洢????????????????????????????????д洢?????????????????????????????????????????????????????????????????????????Ч??????????ū??????浽???????????????????????????????????????volatile ????????????????????????????????ж???????????
????25??????????? ???????????
???????????????????????????????????????????????????????????????????????????????????????????????Щ????????????????????????????????????????????????????????й?????????JDK1.5?????Java API????Executor??????????????????????????絥???????δ???????????????????????????????????????????????????????????????????????
????26?????д?????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????wait??notify???????????????????????Semaphore ???? BlockingQueue?????????????????????
????27????α?????????
????Java??????е????? ?????????????????????????????й????У?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????á??????????????????????????????????????????????????????????????????????????????????????????????????????а?????????????????????????γ?????β??????????????????
?????????????????????????????????????????????е??????????λ???????漲???е??????????????????????????????????????????????????