I have a quite big problem.
I have developed an app that include time count, and sometimes it loses concurrency. I have manage to find the source of it, I think it is cause by preemption of the windows. I have used both java Timer’s and try different configurations and threads but the time error always occur if I start to do something else while running my developed app. On 30 minutes time count I have approximately 4,5s error (Windows XP). When I do nothing else on the computer (mining I don’t click other programs) there is no time error. The error gets quite big running on Windows 7.
If there is some kind of way to minimize preemption of the windows (As I know there is no way to stop this mechanism).
Maybe I am wrong and the time count error is caused by something else.
Can you post your code? Ideally reduced to something that illustrates the problem?
One thing to note regarding java.util.Timer: "This class does not offer real-time guarantees: it schedules tasks using the Object.wait(long) method."
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
posted 9 years ago
Yes I know about that note in awt timer, but I try both timer... on swing timer is the same
hear is simplified code (the error also occur during this code)
Maybe there is some kind of more occur method of time count?
I have checked an when I change the priority of my app in windows task manager priority to RealTime there is absolutely no error. Is there some way to set tis parameter permanently from java code? If not how to change it permanently from windows? I have tried:
But it doesn’t start the java app. Does somebody know any working solution?