Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ThreadPoolExecutor to use try-with-resources #2579

Open
lintool opened this issue Aug 27, 2024 · 0 comments
Open

Refactor ThreadPoolExecutor to use try-with-resources #2579

lintool opened this issue Aug 27, 2024 · 0 comments

Comments

@lintool
Copy link
Member

lintool commented Aug 27, 2024

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 ...
 }
lintool added a commit that referenced this issue Sep 6, 2024
+ dense searchers batch_search - change method signature to take queries, then qids - to be consistent
  with SimpleSearcher and SimpleImpactSearcher
+ dense searchers: refactor ThreadPoolExecutor to use try-with-resources, see #2579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant