java - 关于并发的一个问题
PHP中文网
PHP中文网 2017-04-18 10:10:07
0
1
388
PHP中文网
PHP中文网

认证0级讲师

reply all (1)
洪涛

ConcurrentHashMap lastRequestMap = ...

long now = System.currentTimeMillis()
Long lastRequestTime = lastRequestMap.get(userid)
if(lastRequestTime != null && lastRequestTime > now - 5秒钟) {

return;

}
lastRequestMap.put(userid, now)
......

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!