Einzelnen Beitrag anzeigen

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