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.
我正在为用户之间的即时通讯提供服务。在这个程序中,主要有两个Class,一个用于通知,另一个作为总机,就像MSN一样。现在我要在这两个Class(独立进程)之间共享一个Map对象,这个Map会被频繁遍历。 如何以有效的方式共享此 Map 对象?
考虑到我必须经常遍历它,我认为将对象存储到 HD 中然后从 HD 读取它不会有效。 我可以在 C 中使用像内存映射这样的方式吗?如何?
尝试使用 Java NIO 中的 MemoryMappedByteBuffer