What is the difference between the number of cores and the number of logical processors?

29,309

Solution 1

Hyper-threading will make one physical core appear to the OS as two.

Hyper-threading essentially allows one core to execute two sets of instructions at once, depending on the nature of the instructions. When it was first introduced (back in 2002, and it was quite the buzz at the time, with overclockers and then-new bloggers going crazy debating HT vs. true multicore - some things never change) it was sort of like "dual core lite". To make the use of hyperthreading transparent to existing software and operating systems, they were designed to appear as two cores, and so the kernel could continue using its existing scheduling and load balancing and take advantage of hyperthreading without any changes (later, of course, optimizations were made). That's why it started that way - so that hyperthreaded CPUs could just be drop-in replacements on platforms that already had multiprocessor support anyways.

Anyways, since efficiency will depend on the nature of the application you may wish to do a bench mark at 8 and 16 (and higher if the processes are not CPU bound but, e.g. network or IO bound).

Solution 2

Number of cores (8) represents the actual number of physical cores. For each processor core that is physically present, the operating system addresses two virtual or logical cores, and shares the workload between them when possible.

Where multiprocessing systems include multiple complete processing units, multithreading aims to increase utilization of a single core by using thread-level as well as instruction-level parallelism. As the two techniques are complementary, they are sometimes combined in systems with multiple multithreading CPUs and in CPUs with multiple multithreading cores.

See Wikipedia's articles on HyperThreading and Multithreading.

Share:
29,309

Related videos on Youtube

Borealis
Author by

Borealis

Updated on September 18, 2022

Comments

  • Borealis
    Borealis over 1 year

    I have been doing some image processing on my computer using Erdas Imagine. Specifically, I am running a 5x5 median filter on imagery. I can specify the number of processes that occur simultaneously within the Erdas batch command window. I have been observing unusual behavior when I specify 16 simultaneous processes, which lead me to double check the number of processors on the machine. I used the following command prompt command to assess the number of processors:

    wmic cpu > cpu.txt
    

    Which yielded (in part):

    Number of Cores: 8 
    Number of Logical Processors: 16
    

    How does the number of cores differ from the number of logical processors in the context of software like Erdas imagine where the user can specify the number of simultaneous processes? I am trying to determine if I should be specifying 8 or 16 simultaneous processes to maximize efficiency.

    • HopelessN00b
      HopelessN00b almost 10 years
    • Harry Johnston
      Harry Johnston almost 10 years
      Regarding your final question: in most cases, you'd want 16 processes to maximize efficiency. For memory-intensive operations such as image processing, I'm not sure: I recommend you do some benchmarking and find out what works best for you. You may find that you get the best performance if you disable HyperThreading altogether (it is usually possible to do this via the BIOS settings).
  • HopelessN00b
    HopelessN00b almost 10 years
    This is actually not correct. Hint: Hyperthreading.
  • Harry Johnston
    Harry Johnston almost 10 years
    Note that not all CPUs support HyperThreading and it may also be disabled by the motherboard (this is typically a BIOS option). If HyperThreading is not supported or is disabled, there is only one logical processor per core.
  • Jason C
    Jason C almost 10 years
    There's a short and rather amusing video here. Do not, under any circumstances, attempt to eat the ice cream cone first.