Artifacts Associated With Ticket 1238d4fd
Ticket change [ca011eada4] (rid 247831) by oehhar on 2025-11-01 12:54:33:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Following this description: [https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency] the command "QueryPerformanceFrequency" never retruns NULL since WIndows XP. So, we can assume for 9.1 to always get a non-null. Some code in tclWinTime.c may be removed. Is this ok ? Thanks, Harald
- foundin initialized to: "main"
- is_private initialized to: "0"
- login: "oehhar"
- priority initialized to: "5 Medium"
- private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "oehhar"
- subsystem initialized to: "03. Timer Events"
- title initialized to:
MS-Win Time: QueryPerformanceFrequency does not return NULL since Win XP -> remove legacy code
- type initialized to: "RFE"
Ticket change [59c223f5bb] (rid 247832) by oehhar on 2025-11-01 18:05:53:
- comment changed to:
Following this description: [https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency] the command "QueryPerformanceFrequency" never retruns NULL since WIndows XP. So, we can assume for 9.1 to always get a non-null. Some code in tclWinTime.c may be removed. Same for QueryPerformanceCounter [https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter] Is this ok ? Thanks, Harald
- login: "oehhar"
- mimetype: "text/plain"
- comment changed to:
Ticket change [37dced9f48] (rid 247836) by oehhar on 2025-11-01 18:37:46:
- comment changed to:
Following this description: [https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency] the command "QueryPerformanceFrequency" never retruns NULL since WIndows XP. So, we can assume for 9.1 to always get a non-null. Some code in tclWinTime.c may be removed. Same for QueryPerformanceCounter [https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter] Thanks, Harald
- icomment:
Implemented by checkin [7a350b5f95] starting branch [1238d4fd-mswin-queryperformancefrequency]. If I run the timer.test file, it panics in line 780: [https://core.tcl-lang.org/tcl/file?udc=1&ln=on&name=win%2FtclWinTime.c&ln=780] (I don't know how to show a file of a distinct branch, this is apparently the last commited branch) I have added this panic, as the description says, that this should never happen. Ok. Sorry, Wizard questions for Sergey, Jan, Ashok: * Is this generally a good idea? * Do we still need the calibration thread which runs each second? * Is the deleted part about Pentium 4 really outdated? Line 470-505 of main branch. Thanks for all, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- comment changed to:
Ticket change [a784a9977d] (rid 247841) by apnadkarni on 2025-11-02 10:10:29:
- icomment:
Harald, there was a missing initialization in your changes that caused the panic. Kudos for being paranoid and including that check! Fixed in your branch. timer.test passes Sergey is obviously the best person to answer your queries, but my opinions - - Good idea? I'm all for removing obsolete/dead code. - Need for calibration thread - I would imagine we still need it. Nothing has changed in that regard, has it? - Pentium 4 - I seriously doubt any recent Windows (Win7 on) will run on it and would think it is safe to remove. /Ashok
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [95d5080546] (rid 247844) by oehhar on 2025-11-03 08:26:31:
- icomment:
Thanks, Ashok, great. Sorry, my fault, to have removed the initialisation. I have replaced the panic by an assert in commit [d468a678d1]. I think, this can be merged now. We always use the high performance timers now on Windows. Thanks, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [805086b908] (rid 247857) by sebres on 2025-11-03 13:52:26:
- icomment:
Regarding not-zero return code of QPF/QPC, I'm unsure - the docu says also "if the installed hardware supports a high-resolution performance counter"... And IIRC, a VM may lack high-resolution performance counters if the underlying hypervisor or specific monitoring tools are not configured correctly or are missing certain drivers, so maybe it is too hard to remove it. As regards the calibration thread - I removed it in [fdfbd5e10] (rewritten windows high-resolution time completely without calibration thread), so however it is indeed unneeded, but certain internal adjustment is necessary to avoid "heavy" time drifts (basically part of calibration moved to time API and invoked at some circumstances by any thread to adjust QPC timer to low-resolution clock).
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [7efa15be74] (rid 247858) by oehhar on 2025-11-03 14:22:58:
- icomment:
Thanks, Sergey, I have hoped (and feared) your reponse. "1000 times faster". But nobody will ever touch it, as we have nobody who understands only 5 % of it. So, your answer is: "do not merge". I respect this, no problem. Neverhteless, I read the documentation differently. IMHO, there is a clear statement, that the two functions will never return NULL starting with Windows XP. If would be sooo great to rewrite all this, but I see no hope, sorry. Thanks for all, Harald
- login: "oehhar"
- mimetype: "text/plain"
- icomment:
Ticket change [f11872a45c] (rid 247859) by oehhar on 2025-11-03 14:23:14:
- closedate changed to: "2460983.09947492"
- closer changed to: "oehhar"
- login: "oehhar"
- mimetype: "text/plain"
- status changed to: "Closed"
Ticket change [e9592d2d59] (rid 247861) by oehhar on 2025-11-03 14:34:36:
- closedate changed to: "2460983.10737169"
- icomment:
Restored Tcl_Panic by [c39d459072] as seen as critical. Closed ticket and branch as seen as not safe for VMs. Thanks for all and take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"