Einzelnen Beitrag anzeigen

DevidEspenschied

Registriert seit: 7. Sep 2006
Ort: Berlin
439 Beiträge
 
Delphi 12 Athens
 
#61

Re: core2duotemp.c to core2duotemp.pas

  Alt 30. Mai 2008, 16: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