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.
有人知道java中模拟检查点的并行应用程序/基准吗?我的意思是,在我的集群中,不同节点中运行着并行进程,我想让它们同时执行一些特定操作(例如,有一个检查点)。这种同步是如何实现的?
谢谢
如果并发线程在同一个 VM 中运行,只需使用 CyclicBarrier 或 Latch。如果它们在不同的 VM 中运行,您可以使用 Terracotta 跨 JVM 共享 Latch 或 CyclicBarrier,然后您的所有服务器都可以在其上进行同步。效果很好,但它需要一些工作。
您可以尝试 hazelcast,它提供了此功能,但对系统其余部分的触感比赤土陶器要轻(比您需要的更多)