![]() |
Re: core2duotemp.c to core2duotemp.pas
Actually like this:
Delphi-Quellcode:
This function must run within a FOR-TO-DO loop to set the processors. The number of processors (which is part of the FOR-TO-DO loop) can be detected by using the GetSystemInfo function (
FUNCTION SetProcessorNr(Nr : Byte) : Boolean; {0 until 31}
VAR Process : THandle; BEGIN Process:=GetCurrentProcess; Result:=SetProcessAffinityMask(Process, (1 SHL Nr)); END; ![]() ![]() Hope that helps. |
Re: core2duotemp.c to core2duotemp.pas
Well this wont work
Delphi-Quellcode:
procedure TMainFrm.JvThreadTimer1Timer(Sender: TObject);
var msr:tmsr; omcdrv:tmsrio; x:dword; s:string; o:integer; begin SetThreadAffinityMask(jvthreadtimer1.Thread.Handle,$0008);//for the 4th core omcdrv.ReadMSR($19C,msr); x := msr.LowPart; x:=x shr 16 and $0000ff ; s:=Format('%8.8x', [x]); o:=100-HexToInt(S); rzlabel8.caption:=inttostr(o)+' °C'; end; |
Re: core2duotemp.c to core2duotemp.pas
Ok ok i wrote a function however it dosent do its job very well...
Delphi-Quellcode:
Function IntelCore(ThreadAffinity:Cardinal;Mask:dword):string;
var msr:tmsr; omcdrv:tmsrio; x:dword; s:string; o:integer; begin SetThreadAffinityMask(ThreadAffinity,mask); omcdrv.ReadMSR($19C,msr); x := msr.LowPart; x:=x shr 16 and $0000ff ; s:=Format('%8.8x', [x]); o:=100-HexToInt(S); result:=inttostr(o)+' °C'; end; Am i confused couse i cant figure the mask for the thread....please! :wall: |
Re: core2duotemp.c to core2duotemp.pas
Zitat:
Zitat:
Learn the things you do and stop copying! |
Re: core2duotemp.c to core2duotemp.pas
Zitat:
I hope he can solve this problem... At least there is a C and C++ sample, which demonstrates how to use this affinity setting. |
Re: core2duotemp.c to core2duotemp.pas
Liste der Anhänge anzeigen (Anzahl: 1)
Guys i already did that with the RdMsrEx it works fine it was ment for other driver but ok.
Now another problemo Cpu detection and cpuid...i guess thats hard as hell. :gruebel: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:04 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz