???????????runnable????????????thread????

Thread th1=new Thread(new thread_runnable());
Thread th2=new Thread(new thread_runnable());
Thread th3=new Thread(new thread_runnable());
th1.start();
th2.start();
th3.start();

????????????321321321

???????????????????????????runnable???????????????????????

????????????????н????runnable??????????????????thread??????????????????

???????????????????Thread????????ε???start????????????????????????Thread???????????????????Thread??ζ???????????????????start???????????????????start??????????????????Thread??н?????????£?????????????????е??

??????????????

????a)??????饗??????????Synchronized??????{}??

????i.Synchronized????????????????и????λ???????????synchronized??????У???????????????λ???0???????????????????????????????????????е???????????????????????????????????????????????????г?????????????λ???1??????????????????????????????????????????????????????

????ii.??????????????λ???????run???????漲?????????????????????????????????????????????????????????run???????????ζ?????????μ???λ???????????????е?run?????????????????????λ??????????????????????????????runnable????н??ж?????

????b)???????????????????????public??void??????synchronized??

????i.????????????????????????????????????????????????????????????????????

????ii.????????????????this????????????λ??????this???????????

????c)???

????i.???????????????????????????????????????????????λ??????????????????????????????????????????鯔?????????????????λ???????????????????

????ii.????????Start???????????????????????????????????????????????????????????е?????

??????????????

????a)?????????????????synchronized????????????????????????????????????????????????????wait??notify????notifyall???????????????????????????.wait()??????.notify()??????.notifyAll()????????????????Illegal?????

????b)Notify??????????????£????????????λ??????????wait??????notifyall????????е?????????????μ???????λ??????????