This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
There are so many issues to consider. You need to start by reading chapter 14 of The Java Programming Language, 4th edition. Section 14.10 (including all its subsections) is the real mind-blower (the Java memory model).
I would like to create a new thread. We currently have a web application where we do create a Timer. Our concern is with the Timer object it will wake up run when or original Timer object is still running. Our task could run for a long time so looking at the javadoc a "Timer tasks should complete quickly." Timer Javadoc So I would like to create a new thread when our web application starts and have that keep processing then sleep. We would only need one thread to do this.
I tried just calling Thread.sleep() but then my web application never started. Then I realized I need a separate thread for this...