I have a question regarding the scheduleAtFixedRate() method on ScheduledExecutorService in Java 6.
[edit: the Javadoc for 1.6 is more complete than that for 1.5. See comment below]
Given that:
What happens in this case (times are not meant to be absolute, in the real-time sense):
Is the service guaranteed to do any of the following?
Or something else? Does the answer change if N > 1 ?
The answer is
(b) block until task1 is finished
and that is regardless of number of threads of the executor (task2 might even be not submitted).
The doc says:
If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
(BTW, since there's no intial delay, "task1" will kickoff right away as doc`ed:
executions will commence after initialDelay
).
From the documentation that you linked...
If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With