I have a web application that syncs with a central database four times per hour. The process usually takes 2 minutes. I would like to start this process as a thread in X: 55, X: 10, X: 25 and X: 40, so that users know that in X: 00, X: 15, X: 30 and X: 45 they have a clean copy of the database. It is only about managing expectations. I went through the executor in java.util.concurrent , but the scheduling is done using scheduleAtFixedRate , which, it seems to me, does not guarantee when it really does work in terms of hours. I could use the first delay to run Runnable , so that the first is close to the start time and schedule for every 15 minutes, but it seems like it probably diverges in time. Is there an easier way to schedule a stream 5 minutes before every quarter hour?
java multithreading concurrency
rmarimon
source share