2
沒有人知道不平行運行,如果在java.util.concurrent中的下列Java方法包裝ScheduledExecutorService.html#scheduleAtFixedRate()
Java的安排執行程序:它保證如果任務HAST尚未完成
絕對保證,該計劃的Runnable會在並行的情況下,永遠不會運行在「最後」運行的可運行還不完:
例如(僞)
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.
非常感謝您 月
我懷疑,問這個問題是任何不是簡單地閱讀你所提到的方法的Javadoc更快;) – sfussenegger 2009-10-27 17:40:46
你好sfussenegger, 問題是我讀了Java doc和搜索在javadoc的信息,但不知何故忽視它... – jan 2009-10-27 17:48:13