Java Scheduled Executor : 작업이 아직 완료되지 않은 경우 병렬로 실행되지 않도록 보장합니까?

StackOverflow https://stackoverflow.com/questions/1632371

  •  06-07-2019
  •  | 
  •  

문제

java.util.concurrent 패키지의 다음 Java 메소드가 있는지 아는 사람이 있습니까? ScheduledExecutorService.html#scheduleAtFixedRate()

"마지막"런에서 런 가능한 런에서 아직 끝나지 않은 경우에도 실행 가능한 예약이 병렬로 실행되지 않을 것이라고 절대 보장합니다.

예를 들어 (의사 코드)

1.00 o'clock: scheduleAtFixedRate(MyRunnable, "Run ever Hour")`
//1.30 o'clock: MyRunnable Has finished (everthing is fine)
2.00 o'clock: MyRunnable is triggered to run again
3.00 o'clock: MyRunnable has NOT yet finished ==> What will happen here? 
Will java Simply SKIP the starting of MyRunnable (as the old instance has not yet 
finished) and try again at 4 o'clock or will Java start a NEW MyRunnable that then will 
run in parallel to the "old" MyRunnable.

정말 감사합니다 Jan

도움이 되었습니까?

해결책

로부터 문서:

이 작업의 실행이 기간보다 오래 걸리면 후속 실행이 늦게 시작될 수 있지만 동시에 실행되지는 않습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top