[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Timers not firing properly

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Timers not firing properly
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sun 19 Apr 2009 02:43 PM (UTC)  quote  ]
Message
The way I understood the problem was that the Windows API gave you an A-OKAY response on the availability of the feature, but returned buggy values. If you weren't checking for the availability.. well, then I agree, MUSHclient needs fixing to check for the availability. :)
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 19 Apr 2009 11:11 AM (UTC)  quote  ]
Message
Quote:

MUSHclient can't be the only application that has faulty behaviour due to bugginess of the CPU implementation of QueryPerformanceCounter.


It isn't really the CPU's fault - the OS gives me a way of finding if the performance counter is implemented, and I check it most times. This one slipped through.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by TFMurphy   (3 posts)  [Biography] bio
Date Sun 19 Apr 2009 08:50 AM (UTC)  quote  ]
Message
Your Windows may need patching, yes. Or your BIOS, or the HAL or you might even need new hardware. The fix I mentioned is mainly used for AMD CPUs under Windows XP/2003: fixing it for other CPUs or under different versions of Windows requires different things.

MUSHClient does have the capability to do without QPC as-is: it simply checks to see whether QueryPerformanceFrequency returns anything. When QPC is available and is functioning correctly, it does lead to a more accurate timing than just using GetLocalTime... but it's arguably an unneeded accuracy when GetLocalTime should be accurate down to milliseconds already. I only noticed that my computer was suffering from the issue when MUSHClient's timers weren't working properly -- the system time was updating correctly, as was the GetConnectDuration script command I was using in one of my scripts.

I agree that overall, it's best that the underlying issue is fixed. I'm just concerned that the fix may not be as easy for all systems.
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Sat 18 Apr 2009 08:03 PM (UTC)  quote  ]
Message
I think that if that happens, your windows needs patching to work around the bug and not your MUSHclient. MUSHclient can't be the only application that has faulty behaviour due to bugginess of the CPU implementation of QueryPerformanceCounter.

Hell, you listed the solution yourself in this topic. If anything, I'd recommend putting it into the FAQ so people can find information on the subject more easily.
[Go to top] top

Posted by TFMurphy   (3 posts)  [Biography] bio
Date Sat 18 Apr 2009 04:21 PM (UTC)  quote  ]
Message
Timers use it because they call GetTimeNow in mcdatetime.cpp to both update and reset themselves. GetTimeNow uses both QueryPerformanceFrequency and QueryPerformanceCounter if they're available. Unfortunately, there are a fair number of CPUs where these two commands do not return values you'd expect. My own issue with it was one of these.

It might be useful for there to be an option to not use these commands for checking time. Sure, you lose precision, but better that than not being able to get timers to fire when they're supposed to at all.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Wed 15 Apr 2009 05:45 AM (UTC)  quote  ]
Message
I don't see where timers in particular are using the QueryPerformanceCounter, however if doing that solves the problem I am glad to hear it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by TFMurphy   (3 posts)  [Biography] bio
Date Tue 14 Apr 2009 04:57 PM (UTC)  quote  ]
Message
I recently had to debug this issue on my own computer, and traced the problem to the use of QueryPerformanceCounter by MUSHClient combined with my AMD DualCore processor and my use of Windows XP. The specific issue I was suffering from can be read about here: http://support.microsoft.com/kb/895980

The solution, in my case, was to edit boot.ini and add the /usepmtimer line.

I know this is an old bug report, but seeing how it did not seem to reach a satisfactory conclusion and that this was my first port of call in searching for a solution to my timer problems and trying to figure out why they were taking so long to fire, I thought it best to add my own findings and how I solved it for other people with this problem.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sat 03 Nov 2007 12:15 AM (UTC)  quote  ]
Message
That is very strange. If it is a simple factor, how about simply making the timer interval smaller? For example, for a 10 second timer, actually type in 7 seconds.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Fri 02 Nov 2007 10:44 PM (UTC)  quote  ]
Message
I have tried a 1second timer, which was how I noticed the issue in the first place. Each 1second action was taking about 1.7 seconds to fire when set at 1 second. Thats where I came up with the 75%, since the 10seconds was going to 17.5 and the 1 second was going to 1.7.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Fri 02 Nov 2007 09:05 PM (UTC)  quote  ]
Message
I would still like you to briefly try one firing every second. That might narrow it down a bit to a fixed delay (of a few seconds) or some sort of percentage delay.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Fri 02 Nov 2007 10:58 AM (UTC)  quote  ]
Message
Seems to be almost a 75% delay, as I tried it with a 5sec timer and it fires every 8.6 seconds and other timers and same issues.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Fri 02 Nov 2007 05:08 AM (UTC)  quote  ]
Message
I am mystified by this, particularly as it only seems to happen on this PC.

If you make it to dance every second, do you still have about a 10 second delay?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Fri 02 Nov 2007 03:29 AM (UTC)  quote  ]

Amended on Fri 02 Nov 2007 03:32 AM (UTC) by Natasi

Message
It was set at 0 for the above tests. I just uninstalled Mush and re-installed another new copy and still having the issue. The Global preference Interval is at 1 now, which was teh default. I assume it has something to do with my computer, as I tried it on my macpro and my other pc and I dont have the issue on them...its only on this one. Is there any test that I can perform to figure out wtf is going on?
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Fri 02 Nov 2007 03:14 AM (UTC)  quote  ]
Message
Can you please tell me what timer interval is set up in the Global Preferences -> Timers tab?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Fri 02 Nov 2007 01:37 AM (UTC)  quote  ]

Amended on Fri 02 Nov 2007 02:18 AM (UTC) by Natasi

Message
I just checked my windows and the clock is running fun, I even ran the update on it and still my timer output in mushclient is lagging. I also just downloaded and re-installed the newest mushclient and still having the problem.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


5,417 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]