??????Java??????????
???????????? ???????[ 2015/11/16 14:10:17 ] ??????????????? ???????????
??????????
?????????????????????д??????????????????????????????????????????????????????????п????????????????????????????????κ?????????????????????????????????????????????к?????????????????
???????????????????????????????????????????????????????????????
????public class GameServer {
????public Map<String?? List<Player>> tables = new HashMap<String?? List<Player>>();
????public void join(Player player?? Table table) {
????if (player.getAccountBalance() > table.getLimit()) {
????List<Player> tablePlayers = tables.get(table.getId());
????synchronized (tablePlayers) {
????if (tablePlayers.size() < 9) {
????tablePlayers.add(player);
????}
????}
????}
????}
????//other methods skipped for brevity
????}
?????????????????????????????????????????????е?????????????????????????????????????????????????????????????????????????100??????????????????????????????????????С100????
???????????????????
??????????????????????????????????????????????????????????????????????磬??????ConcurrentHashMap??????????????????????????????????????
????public class GameServer {
????public Map<String?? List<Player>> tables = new ConcurrentHashMap<String?? List<Player>>();
????public synchronized void join(Player player?? Table table) {/*Method body skipped for brevity*/}
????public synchronized void leave(Player player?? Table table) {/*Method body skipped for brevity*/}
????public synchronized void createTable() {
????Table table = new Table();
????tables.put(table.getId()?? table);
????}
????public synchronized void destroyTable(Table table) {
????tables.remove(table.getId());
????}
????}
??????join()??leave()????????????????????????????????????????????????????????????????ConcurrentHashMap ????????????κ???????????????????increateTable()??destoryTable()?????????ConcurrentHashMap???????????μ?????????????Щ????????ConcurrentHashMap????????????????????????????е??????????????????????
?????????Щ????????
?????????????????????????????У??????????public??????????????????????Щ???????????????????????????????????????????????
?????????java.util.concurrent.locks ??API??????? ???????????????????????????????????????????
??????????????????????????????????????????????????????????????????и??????? AtomicInteger????Integer???????????
?????????????????????????Plumber?????????????????????????????????????y????????????????????????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????