Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的一个项目中使用 Hazelcast 分布式地图。从多个节点更新密钥时,我是否需要显式使用 Hazelcast 锁,或者是否会由 Hazelcast 隐式处理,因为 Hazelcast 文档说 IMap 是线程安全的。
它会照顾它。每个键始终只有一个内部线程对其进行变异,因此是隐式线程安全的。但是,如果您有多个操作,例如 get+mutation+put,您将离开线程安全。在这种情况下,EntryProcessor 可能会帮助您。