Skip to content
Discussion options

You must be logged in to vote

The exec method of ForkJoinTask returns false meaning that PerformCleanupTask never stops. So is it necessary to trigger the PerformCleanupTask again for every cache write?

ForkJoinTask is a future so it has a concept of completion which the internal doExec() method checks before it will call exec(). When returning false we indicate that there is a reschedule strategy so that the task may be invoked again if re-submitted to the pool. In FJP's case this is primarily for CountedCompleter while In ours we want each submission of the task to try an execute once and never have the task instance be considered completed. This is because our usage is purely an optimization to avoid an allocatio…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ben-manes
Comment options

You must be logged in to vote
2 replies
@ben-manes
Comment options

@ben-manes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants