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

后端 未结 6 899
执笔经年
执笔经年 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:14

    It does seem that you do not need any synchronization between the workers. Maybe you should consider using the ForkJoin framework which is available in Java 7, as well as a separate library. Some links:

    • Tutorial at Oracle
    • Original paper by Doug Lea

提交回复
热议问题