Is there any way to execute multiple Jobs at the same time? I have programing multiple jobs to exexute at the same time but there were not execute at the time, for example I have programing 6 jobs to execute at 13:45:00, all at the same time, and there were the results:
Being based on Java threads, it's a good idea not to assume that such jobs will all execute at precisely the same time. I strongly doubt that there is a way to make them do so. As the javadocs of the Thread class explain, it's also a good idea not to rely on thread priorities.
Let's say the jobs are executed at 13:45:00 but I don't want these jobs to execute after the 30th second i.e. pass the time of 13:45:30 if I have more than 1000 jobs then the probability of passing 13:45:30 is high, so it won't be right for my use.
What ideas do you have to execute 1000+ jobs without exceeding 30 seconds?, meaning 1000+ jobs are completed within 30 seconds.
Task schedulers generally do not run precisely at an indicated time. Often, in fact, they will be delayed to keep the overall system load in balance.
Aside from that, however, "cron" style tasks are not guaranteed scheduling precision to the fraction of a minute.
If absolute timing of a single task is essential, about the best you're going to be able to do is wake up a few minutes early and keep polling a precision clock - which, by the way, isn't the CPU hardware clock. Those things are constantly having to be adjusted. You'd need special hardware like an atomic clock or at least a GPS time reference.
And forget about precision timing on the execution of multiple concurrent threads. That can be thrown off by a whole raft of things from the number of physical cores, bus timings, bubbles in processor pipelines all the way up to which scheduling algorithm is currently being used.
General-purpose processing systems have mechanisms to allow threads to synchronize, but not to keep or follow precise time or execution between sync points. You need special hardware for stuff like that.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop