Click here to Skip to main content
15,890,741 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
Robert Inventor18-Mar-13 14:44
Robert Inventor18-Mar-13 14:44 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
dusty_dex18-Mar-13 22:08
dusty_dex18-Mar-13 22:08 
AnswerRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
Robert Inventor19-Mar-13 6:19
Robert Inventor19-Mar-13 6:19 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
dusty_dex19-Mar-13 8:34
dusty_dex19-Mar-13 8:34 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
Robert Inventor20-Mar-13 10:10
Robert Inventor20-Mar-13 10:10 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
Robert Inventor20-Mar-13 11:12
Robert Inventor20-Mar-13 11:12 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
dusty_dex20-Mar-13 11:18
dusty_dex20-Mar-13 11:18 
GeneralRe: QueryPerformanceCounter inaccurate timing even with use of SetThreadAffinityMask Pin
Robert Inventor20-Mar-13 12:15
Robert Inventor20-Mar-13 12:15 
Oh right, maybe that is why some users have issues enabling HPET while others find it works just fine for them.

When it comes to musicians, if this is indeed the best way to achieve sub-millisecond precision on Windows with true exact timing - well they might well when buying new computers choose to buy one that can have the HPET enabled without causing problems. You often get exchange of notes and musicians asking each other which computer makes in their experience work best for music making. Normally ones that score well for silence, and latency and DPC. But this seems another thing to add to the list.

It is hard to over-stress how important it is for musicians to be able to play midi notes and record them with sub millisecond precision, and at least - not with multi-millisecond errors.

I just checked it up, I think from this post that RDTSCP is just like RDTSC except that it also tells you the processor id.

Example assembly code here The Terran Comedy[^]

But so long as you don't mind forcing your thread to go to core 1 whenever it checks the time, then SetThreadAffinityMask seems the way to go - I was wrong earlier when I said it seemed that the thread has to sleep first before it works, that was that bug in my own code.

It seems to work instantly somehow - does this mean the scheduler instantly moves the thread to the other core?

I suspect that probably it looks ahead in the code and when it sees a SetThreadAffinityMask in the near future moves it to another core in anticipation.
QuestionHelp in Win32 programming with c++ Pin
naseer86114-Mar-13 8:44
naseer86114-Mar-13 8:44 
AnswerRe: Help in Win32 programming with c++ Pin
NotPolitcallyCorrect14-Mar-13 8:50
NotPolitcallyCorrect14-Mar-13 8:50 
GeneralRe: Help in Win32 programming with c++ Pin
naseer86118-Mar-13 9:41
naseer86118-Mar-13 9:41 
AnswerRe: Help in Win32 programming with c++ Pin
Maximilien14-Mar-13 8:54
Maximilien14-Mar-13 8:54 
AnswerRe: Help in Win32 programming with c++ Pin
Captain Price16-Mar-13 2:55
professionalCaptain Price16-Mar-13 2:55 
QuestionNeed a free image library, png, Visual Studio 6.0 Pin
Andrlage14-Mar-13 5:52
Andrlage14-Mar-13 5:52 
AnswerRe: Need a free image library, png, Visual Studio 6.0 Pin
Richard MacCutchan14-Mar-13 6:22
mveRichard MacCutchan14-Mar-13 6:22 
AnswerRe: Need a free image library, png, Visual Studio 6.0 Pin
_Flaviu14-Mar-13 21:19
_Flaviu14-Mar-13 21:19 
QuestionMSCOWRKS.DLL ? Pin
ForNow13-Mar-13 3:10
ForNow13-Mar-13 3:10 
AnswerRe: MSCOWRKS.DLL ? Pin
Richard MacCutchan13-Mar-13 3:53
mveRichard MacCutchan13-Mar-13 3:53 
GeneralRe: MSCOWRKS.DLL ? Pin
ForNow13-Mar-13 4:12
ForNow13-Mar-13 4:12 
AnswerRe: MSCOWRKS.DLL ? Pin
Albert Holguin13-Mar-13 5:33
professionalAlbert Holguin13-Mar-13 5:33 
QuestionHow to fix Static contol width at run time? Pin
Le@rner12-Mar-13 20:52
Le@rner12-Mar-13 20:52 
AnswerRe: How to fix Static contol width at run time? Pin
Richard MacCutchan12-Mar-13 22:22
mveRichard MacCutchan12-Mar-13 22:22 
GeneralRe: How to fix Static contol width at run time? Pin
Le@rner13-Mar-13 1:25
Le@rner13-Mar-13 1:25 
AnswerRe: How to fix Static contol width at run time? Pin
Parthi_Appu13-Mar-13 1:47
Parthi_Appu13-Mar-13 1:47 
GeneralRe: How to fix Static contol width at run time? Pin
Le@rner13-Mar-13 2:01
Le@rner13-Mar-13 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.