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:
- the ScheduledExecutorService is constructed with N = 1 thread in the pool
- the fixed-rate is a period of T seconds
- no initial delay
What happens in this case (times are not meant to be absolute, in the real-time sense):
- at time T, the service kicks off a Runnable task, "task1"
- at time 2T, task1 has not yet completed, and service is scheduled to fire
Is the service guaranteed to do any of the following?
- (a) at 2T, kick off a Runnable task, "task2" (recall N = 1)
- (b) block until task1 is finished
- (c) skip this time and try again at 3T
- (d) behavior is undefined
Or something else? Does the answer change if N > 1 ?