??????Java??????????
???????????? ???????[ 2015/11/16 14:10:17 ] ??????????????? ???????????
?????????????Plumbr???????????????????????????????Щ????????????????“??????????????????????????????????????????????????????????”
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????С???????÷?Χ???????????????????????κι??????????????
????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????“???”?????????????????п????????????????????????????
?????????????????????????????????????????????????????? ??????????????е????????????????????????????????????????????????????????????鰱???????????????????????????????? ???????????????????????????????????????
??????????????????????o???????????У?JVM??????????????????????????????й????в???????κζ???????????????????????????????????????????????????????????????????????????????????Щ??????????????????????????????????
??????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????
????class GameServer {
????public Map<<String?? List<Player>> tables = new HashMap<String?? List<Player>>();
????public synchronized void join(Player player?? Table table) {
????if (player.getAccountBalance() > table.getLimit()) {
????List<Player> tablePlayers = tables.get(table.getId());
????if (tablePlayers.size() < 9) {
????tablePlayers.add(player);
????}
????}
????}
????public synchronized void leave(Player player?? Table table) {/*body skipped for brevity*/}
????public synchronized void createTable() {/*body skipped for brevity*/}
????public synchronized void destroyTable(Table table) {/*body skipped for brevity*/}
????}
????????????????——??????μ??????????? ??????????????????????????????????????????????????9??
?????????????????????????????????????????????п???——?????????????????????С????????????????Щ?? ?????????????????????????????????????????????????????????????????????????????ò????????????????????????????????????? ???
??????????????????????????????????????????????????????????е???????????????????????????????????????????????????????????????????????????????????????????????join()??????
????class GameServer {
????public Map<String?? List<Player>> tables = new HashMap<String?? List<Player>>();
????public void join(Player player?? Table table) {
????synchronized (tables) {
????if (player.getAccountBalance() > table.getLimit()) {
????List<Player> tablePlayers = tables.get(table.getId());
????if (tablePlayers.size() < 9) {
????tablePlayers.add(player);
????}
????}
????}
????}
????public void leave(Player player?? Table table) {/* body skipped for brevity */}
????public void createTable() {/* body skipped for brevity */}
????public void destroyTable(Table table) {/* body skipped for brevity */}
????}
?????????????????СС??????????????????????????????????????????????????????????????????GameServer???????????????????Щ????????????????????????????????????????????????л????????????????????????????????????
??????С???????÷?Χ
?????????????????????????????????????????????????????????????????——???統(tǒng)??????????????
????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()) {
????synchronized (tables) {
????List<Player> tablePlayers = tables.get(table.getId());
????if (tablePlayers.size() < 9) {
????tablePlayers.add(player);
????}
????}
????}
????}
????//other methods skipped for brevity
????}
???????????????????????????????????IO?????????????????????????????????????????Χ??????????????????????????????????????????????????????????????鯔?????????????????????
??????

???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44