Class PhysicalCoreExecutor

java.lang.Object
io.github.jbellis.jvector.util.PhysicalCoreExecutor
All Implemented Interfaces:
Closeable, AutoCloseable

public class PhysicalCoreExecutor extends Object implements Closeable
A fork join pool which is sized to match the number of physical cores on the machine (avoiding hyper-thread count) This is important for heavily vectorized sections of the code since it can easily saturate memory bandwidth.
See Also:
  • Field Details

  • Method Details

    • pool

      public static ForkJoinPool pool()
    • execute

      public void execute(Runnable run)
    • submit

      public <T> T submit(Supplier<T> run)
    • getPhysicalCoreCount

      public static int getPhysicalCoreCount()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable