java - servlet httpSession 的属性为什么不在内部实现线程同步?
ringa_lee
ringa_lee 2017-04-18 10:00:07
0
1
360
ringa_lee
ringa_lee

ringa_lee

reply all (1)
阿神
  1. HttpSession is just an interface specification, so no specific details are defined;

  2. In the specific implementation of HttpSession, thread safety is considered. For example, all session attributes in Tomcat8 are stored in an independent ConcurrentHashMap;

  3. Blindly locking and synchronizing the session will cause performance problems. When to lock the session actually depends on your specific needs.

    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!