Find the answer to your Linux question:
Results 1 to 5 of 5
Hi! i have a P4 with Hyperthreating (Hyperthreating simulates 2 CPUs) and i want to code a simple prog like counting from 1 to 50000. but i what to make ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie robak's Avatar
    Join Date
    Jan 2004
    Posts
    136

    Hyperthreating with C++


    Hi!

    i have a P4 with Hyperthreating (Hyperthreating simulates 2 CPUs) and i want to code a simple prog like counting from 1 to 50000. but i what to make a small konsole-menu at the beginning of that prog where the user can choose on what CPU the prog should run. is this possible?


    thx in advance!
    make install not love

    Registered Linux user number 369245

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I'm fairly sure it's called Hyperthreading. Hyperthreating would be something completely different. =)

    However, it's usually not possible to choose that, since it's virtually pointless. Why would you want to do that at all?

    Also, I'm not sure that Hyperthreading works just like that... the way I've understood it, it's not really 2 CPUs, just that the functional units in the CPU can operate on two seperate tasks, thereby minimizing each function unit's idle time.

  3. #3
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    My understanding of HT(Hyperthreading) is that when impropperly used it will _slow down_ the processing. I haven't read the specs for it, but I guess that it's like MMX, SSE, 3Dnow!, "Prescott"(or what that workname is) etc it will only be avalible (initailly at least) to low level coders (asm, opcode/hexcode level).
    I'm not sure, but I think HT is like (or thought to be) the replacement/enhancement u and v pipelines.
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I just checked Intel's documentation on HT, and it is as I thought. There is one CPU core, but it has duplicate state units (that contains the registers and so on). They share the functional units in the CPU core, so the main thing about it is that it minimizes pipeline stalls. Quite ingenious, if I may say so.

    It's available to all programs as long as the kernel supports it. It behaves almost exactly as if you had two seperate CPUs (only you don't get the same performance, of course).

  5. #5
    Linux Newbie robak's Avatar
    Join Date
    Jan 2004
    Posts
    136
    scientica wrote:

    "I'm not sure, but I think HT is like (or thought to be) the replacement/enhancement u and v pipelines."

    what are these pipelines ?


    yes it is called hyperthreading, my fault

    but is it possible to just create 2 instances and that those would be completely independet from each other so that that both "cpus" would be at 100% in-use??



    p.s: sry 4 my bad english
    make install not love

    Registered Linux user number 369245

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •