What is the fastest cyclic synchronization in Java (ExecutorService vs. CyclicBarrier vs. X)?

后端 未结 6 986
执笔经年
执笔经年 2021-02-02 15:45

Which Java synchronization construct is likely to provide the best performance for a concurrent, iterative processing scenario with a fixed number of threads like the one outli

6条回答
  •  青春惊慌失措
    2021-02-02 16:07

    Just hit upon this thread, and even though it's almost a year old let me point you to the "jbarrier" library we developed at the University of Bonn a few months ago:

    http://net.cs.uni-bonn.de/wg/cs/applications/jbarrier/

    The barrier package targets exactly the case where the number of worker threads is <= the number of cores. The package is based on busy-wait, it supports not only barrier actions but also global reductions, and apart from a central barrier it offers tree-structured barriers for parallelizing the synchronization/reduction parts even further.

提交回复
热议问题