Pentium 4's

Talk about anything else you want

Moderator: BigEvilCorporation

Post Reply
evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Pentium 4's

Post by evildragon » Mon Sep 03, 2007 11:54 pm

I have a Pentium 4, and in task manager, it's showing up as a dual core processor (i see two CPU windows). All programs I run show it as a dual processor system.

BUT, when I write a program to address the second CPU, it's just not there..

I have a dual Pentium III server, and tested my code there, and it works just fine.

What's going on? the Pentium 4 is 3.0GHz..

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Tue Sep 04, 2007 3:41 am

Many P4s have a feature called hyperthreading. Basically, the processor has hardware to keep track of the execution state of 2 threads at once, but only has one set of execution hardware. It basically reduces the cost of a context switch between two threads if those threads are both running on the CPU.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Tue Sep 04, 2007 5:08 am

Mask of Destiny wrote:Many P4s have a feature called hyperthreading. Basically, the processor has hardware to keep track of the execution state of 2 threads at once, but only has one set of execution hardware. It basically reduces the cost of a context switch between two threads if those threads are both running on the CPU.
so is it then impossible to force the CPU to spend more time on one code without taking resources way from the whole CPU?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Sep 04, 2007 10:45 pm

Mask of Destiny wrote:Many P4s have a feature called hyperthreading. Basically, the processor has hardware to keep track of the execution state of 2 threads at once, but only has one set of execution hardware. It basically reduces the cost of a context switch between two threads if those threads are both running on the CPU.
Actually, the reason Intel did hyper-threading is because the P4 "Netburst" architecture had EXTREMELY long pipelines. A stall in the pipe was horribly expensive in terms of latency, so Intel put those stalls to good use by allowing another logical core to use the execution units during a stall of the first logical core until IT stalled as well.

The idea was since a stalled core wasn't doing anything, let another logical core do something. This results in about 15-30% better usage of the Netburst unit execution cycles than one core alone, on average.

Anyway, the logical cores don't include the MMU, so both core have to be executing code using identical MMU tables. Hence, threads of the same process, not different processes. This also holds off one core while the other handles interrupts and other code that executes in a different memory space.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Fri Sep 07, 2007 1:40 am

installed OS X on this system today (yea, the hacked x86 version), and it seems to be true what MoD said..

OS X reports 1 core, and 1 CPU, but Activity Monitor shows two CPU graphs..

Post Reply