8000 Refactor ThreadPoolExecutor to use try-with-resources · Issue #2579 · castorini/anserini · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Refactor ThreadPoolExecutor to use try-with-resources #2579
Open
@lintool

Description

@lintool

We use ThreadPools in many places throughout the codebase, e.g.,
https://github.com/castorini/anserini/blob/master/src/main/java/io/anserini/search/HnswDenseSearcher.java

Best practices starting Java 19 I believe is to use try-with-resources blocks, e.g.,
https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/concurrent/ExecutorService.html

 try (ExecutorService e =  Executors.newWorkStealingPool()) {
   // submit or execute many tasks with e ...
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0