Scheduling Recurring Tasks In Java Applications
By Tom White2004-01-23
Resources
• Download the source code used in this article.
• "Tuning Garbage Collection with the 1.3.1 Java Virtual Machine" is a very useful article from Sun with hints on how to minimize your GC pauses.
For even more information on GC from developerWorks, see the following articles:
- "Java theory and practice: A brief history of garbage collection" (October 2003)
- "Mash that trash" (June 2003)
- "Fine-tuning Java garbage collection performance" (January 2003)
- "Sensible sanitation, Part 1" (August 2002)
- "Sensible sanitation, Part 2" (August 2002)
- "Sensible sanitation, Part 3" (September 2002)
• In "Java theory and practice: Concurrency made simple (sort of)" (developerWorks, November 2002) Brian Goetz discusses Doug Lea's
util.concurrent library, a treasure trove of concurrency utility classes.
• Also by Brian Goetz, "Threading lightly, Part 2: Reducing contention" (developerWorks, September 2001) examines thread contention and how to reduce it.
• Here's the documentation for Timer and TimerTask in the Java SDK 1.4.
• Jcrontab is another scheduler written in the Java language, with the emphasis on replacing
cron.
• The Network Time Protocol (NTP) is a protocol for synchronizing computer clocks.
• The Real-time Specification for Java is an extension to the Java platform that provides real-time guarantees. This site also includes a reference implementation.
• Effective Java Programming Language Guide by Joshua Bloch (Addison-Wesley, 2001) contains excellent advice (for instance, Item 51: Don't depend on the thread scheduler).
• For everything you want to know about the world's calendars and the algorithms to work with them, see Calendrical Calculations by Nachum Dershowitz and Edward M. Reingold (Cambridge University Press, 1997).
• Chapter 17, Threads and Locks, of The Java Language Specification, Second Edition by James Gosling, Bill Joy, Guy L. Steele Jr., and Gilad Bracha (Addison-Wesley, 2000) specifies the behavior of the thread scheduler.
• Concurrent Programming in Java: Design Principles and Patterns by Doug Lea (Addison-Wesley, 1999) is a great book that delves into all aspects of concurrency in the Java platform.
• You'll find hundreds of articles about every aspect of Java programming in the developerWorks Java technology zone.
Tutorial Pages:
» Introduction
» Scheduling a one-shot task
» Scheduling a recurring task
» Implementing the scheduling framework
» Extending the cron facility
» Real-time guarantees
» Conclusion
» Resources
First published by IBM developerWorks
