Dual-Processor Support

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Barliesque
New User
New User
Posts: 1
Joined: Sun Sep 21, 2003 9:30 pm

Dual-Processor Support

Post by Barliesque »

There probably aren't that many users out there with two processors in their machines, but with Pentium's Hyperthreading--which simulates a dual-processor machine--there are going to be more and more users who have this kind of power.

At the moment, PureBasic can only make use of 50% of my CPU's power. I've got a P4 3GHz with Hyperthreading. If PureBasic were to support a dual-processor environment, then I'd get 6GHz of performance. :twisted:
GPI
PureBasic Expert
PureBasic Expert
Posts: 1396
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

I think, that this is on the not existing to-do-list the very,very last point...
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

there was some one that tried doing this through threading, i think he succedded
heres the link viewtopic.php?t=7409
~Dreglor
TheBeck
User
User
Posts: 39
Joined: Mon May 12, 2003 6:04 am
Location: the far west
Contact:

Post by TheBeck »

At the moment, PureBasic can only make use of 50% of my CPU's power. I've got a P4 3GHz with Hyperthreading. If PureBasic were to support a dual-processor environment, then I'd get 6GHz of performance.
LOL!

Hyperthreading does not double performance. What it does is very complex and I am not going into it here, but here is a good primer.

To take advantage of dual processors or Hyperthreading, you make two threads and split the workload between them. That is all there is to it, the OS takes care of the rest. So pure basic DOES support Hyperthreading and probably supports it better than most other languages. How do you do multiple threads in C? I bet it is a lot harder than PureBasic.
Berikco
Administrator
Administrator
Posts: 1330
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Hyperthreading on a P4 3Ghz does not give you 6Ghz power ! LOL
The best performance gain i see so far was about 15 percent.
Note that some apps that use floating point heavely can even slow down with hyperthreading.
Even two real CPU's dont give 200 percent performance, the best factor is about 160-170 percent under w2k (NT4 was about 150 to 160)
Adding a 3de and 4the CPU will add even less performance!

I tested PureBasic on a QUAD P4 XEON machine with w2k server one year ago, it works fine.
It was just a simple test though, I created some extra threads that did some calculations (no strings) and a could see the CPU load in the task manager performance screen very nicely :)

It wil be very easy to use if Fred manages to fix this string problems in threads :)
Berikco
Post Reply