Mutator和共享Mutator的区别是什么?
在变形器的规范中,有一个"flush_interval“(自动刷新间隔,单位为毫秒;0表示禁用)。参数。
在共享Mutator的规范中,它声明:
WARNING: Shared mutators sacrifice write durability guarantee because they buffer and flush mutations on a periodic time interval and the set_ methods return without knowing if the mutations succeeded or failed.Reference
那么,如果两者都有刷新间隔,又有什么区别呢?
此外,两者都是线程安全的(在Java中)吗?
另外,就性能而言,哪个更有效率?
发布于 2012-09-20 00:26:28
在我看来,因为共享的变更器不检查返回状态,所以它们会运行得更快,并且可能会允许几个并行操作。这是一种权衡,前提是它不能保证成功。
赋值器似乎更可靠,但它需要更多的时间(文件大小较小,差异可以忽略)。
当我有更多的时间时,我会扩展这个
https://stackoverflow.com/questions/12498195
复制相似问题