SpringMVC:学习笔记(12)——ThreadLocal实现会话共享 ThreadLocal ThreadLocal,被称为线程局部变量.在并发编程的情况下,使用ThreadLocal创建的变量只能被当前线程访问,其他线程则无法访问和修改.每个Thread对象内部都维护了一个ThreadLocalMap它可以存放若干个ThreadLocal.如下为Thread源码部分: /* ThreadLocal values pertaining to this thread. This map is…
python学习笔记整理 数据结构--字典 无序的 {键:值} 对集合 用于查询的方法 len(d) Return the number of items in the dictionary d. 返回元素个数 d[key] Return the item of d with key key. Raises a KeyError if key is not in the map. If a subclass of dict defines a method _missing_() and key…