楼主,像您这样的情况,我以前遇到过,别人说正常.
我拿你的代码,把2万张火车票卖给大家,解决铁道部的问题,让大家可以国庆回家.
卖到差不多3000多张的时候,才有其它线程执行.你把票提高到2千或2万,多运行几次就行了.
Thread-0....sale : 16990
Thread-0....sale : 16989
Thread-0....sale : 16988
Thread-0....sale : 16987
Thread-0....sale : 16986
Thread-0....sale : 16985
Thread-0....sale : 16984
Thread-0....sale : 16983
Thread-0....sale : 16982
Thread-0....sale : 16981
Thread-0....sale : 16980
Thread-0....sale : 16979
Thread-0....sale : 16978
Thread-0....sale : 16977
Thread-0....sale : 16976
Thread-0....sale : 16975
Thread-0....sale : 16974
Thread-0....sale : 16973
Thread-0....sale : 16972
Thread-0....sale : 16971
Thread-0....sale : 16970
Thread-0....sale : 16969
Thread-0....sale : 16968
Thread-0....sale : 16967
Thread-0....sale : 16966
Thread-0....sale : 16965
Thread-0....sale : 16964
Thread-0....sale : 16963
Thread-0....sale : 16962
Thread-0....sale : 16961
Thread-0....sale : 16960
Thread-0....sale : 16959
Thread-0....sale : 16958
Thread-0....sale : 16957
Thread-0....sale : 16956
Thread-0....sale : 16955
Thread-3....sale : 16954
Thread-3....sale : 16953
Thread-3....sale : 16952
Thread-3....sale : 16951 |