Autor Beitrag
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Mo 24.07.06 20:51 
Hallo Leute!
Ich möchte eine Software programmieren die auf allen denkbaren Hardwaresystemen möglichst effizient läuft. Dazu müsste ich verschiedene Threads (bei Multicore-Systemen) auf die einzelnen CPUs bzw. (bei Hyperthreading-Systemen) auf die verschiedenen Hyperthreads. Nun soll das aber nicht beliebig geschehen, sondern möchte ich, dass ganz bestimmte Threads auf der zweiten oder dritten Schiene laufen.
Nun meine Fragen. Erstens: Ist es möglich die Threads manuell auf die Cores zu verteilen? Zweitens: Wenn ja, wie? Drittens: Wie finde ich heraus, ob ein System einen Prozessor, einen Hyperthreading-Prozessor oder mehrere Prozessoren (Anzahl) hat?

Danke schonmal!
Alstar


Moderiert von user profile iconMotzi: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Mo 24.07.2006 um 21:00
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Mo 24.07.06 21:00 
Schau dir mal die Funktion SetThreadAffinityMask an.
Alstar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Mo 24.07.06 21:05 
Okay, vielen Dank!
Werden die Hyperthreads des P4 auch als eigener Prozessorkern angesehen?

Alstar
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 24.07.06 21:05 
Anzahl CPUs: GetSystemInfo
Thread auf bestimmten CPUs ausführen: SetThreadAffinityMask und SetThreadIdealProcessor
Viruteller Prozessor (Hyperthreading) oder realer Processor: musst du mal googlen, da gabs IMHO ne ASM-Operation..

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 24.07.06 22:31 
Hi, wenn Du die Instruction CPUID meinst ... Die gibt immer die Logische CPU-Anzahl zurück ... D.h. bei einem DualCore bzw. HT-System 2 CPUs ... siehe ggf. auch die Omorphia-Unit OHWProcessors.pas.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 24.07.06 22:44 
Nein, es gibt auch eine spezielle CPUID Instruction die dazu gedacht ist virtuelle von physikalischen Prozessoren zu unterscheiden, um Multitasking zu optimieren, da ein virtueller Prozessor schließlich nicht dieselbe Leistung wie ein realer hat..!

Edit: ein Link dazu: www.intel.com/cd/ids...eng/211924.htm?prn=Y

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Alstar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Di 25.07.06 21:59 
Okay. Vielen Dank für die Hilfe, das wird mir erstmal weiterhelfen :wink:

Alstar