AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

core2duotemp.c to core2duotemp.pas

Ein Thema von hathor · begonnen am 5. Aug 2007 · letzter Beitrag vom 31. Mai 2008
Antwort Antwort
Seite 7 von 7   « Erste     567   
devidespe

Registriert seit: 7. Sep 2006
Ort: Berlin
434 Beiträge
 
Delphi 10.4 Sydney
 
#61

Re: core2duotemp.c to core2duotemp.pas

  Alt 30. Mai 2008, 15:31
Actually like this:

Delphi-Quellcode:
FUNCTION SetProcessorNr(Nr : Byte) : Boolean; {0 until 31}
VAR Process : THandle;
BEGIN
  Process:=GetCurrentProcess;
  Result:=SetProcessAffinityMask(Process, (1 SHL Nr));
END;
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 (here), where the SYSTEM_INFO structure (here again) contains the value dwNumberOfProcessors as DWord.

Hope that helps.
Devid
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#62

Re: core2duotemp.c to core2duotemp.pas

  Alt 30. Mai 2008, 15:48
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;
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#63

Re: core2duotemp.c to core2duotemp.pas

  Alt 30. Mai 2008, 16:03
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!
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#64

Re: core2duotemp.c to core2duotemp.pas

  Alt 30. Mai 2008, 21:49
Zitat von Razor:
Delphi-Quellcode:
...
s:=Format('%8.8x', [x]);
o:=100-HexToInt(S);
...
Oh my god. So I see, you have not learned anything. All I see in this small part, that you have not understand something from our ICQ contact. It is really sad to this...

Zitat von Razor:
Am i confused couse i cant figure the mask for the thread....please!
You use a external ring-0 driver, so this setting in your application/process/thread will not change anything. Your driver offers the option to pass the affinity mask within the calls. You have to use this parameter. Any call to SetProcessAffinityMask() or to SetThreadAffinityMask() will only be honoured by code in your application/thread. As I know, you do nothing inside your app, so it is useless.

Learn the things you do and stop copying!
  Mit Zitat antworten Zitat
devidespe

Registriert seit: 7. Sep 2006
Ort: Berlin
434 Beiträge
 
Delphi 10.4 Sydney
 
#65

Re: core2duotemp.c to core2duotemp.pas

  Alt 31. Mai 2008, 10:13
Zitat von Muetze1:
You use a external ring-0 driver, so this setting in your application/process/thread will not change anything. Your driver offers the option to pass the affinity mask within the calls. You have to use this parameter. Any call to SetProcessAffinityMask() or to SetThreadAffinityMask() will only be honoured by code in your application/thread. As I know, you do nothing inside your app, so it is useless.
Thats right, but for that you have to use the RdmsrEx function instead of Rdmsr. Only the RdmsrEx function contains the AffinityMask as DWord Pointer.

I hope he can solve this problem... At least there is a C and C++ sample, which demonstrates how to use this affinity setting.
Devid
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#66

Re: core2duotemp.c to core2duotemp.pas

  Alt 31. Mai 2008, 10:51
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.
Angehängte Dateien
Dateityp: rar probtec_101.rar (344,6 KB, 41x aufgerufen)
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 7 von 7   « Erste     567   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz