Jump to content

Dark_Fuzzy

Member
  • Posts

    212
  • Joined

  • Last visited

Reputation Activity

  1. Agree
  2. Agree
    Dark_Fuzzy reacted to vanished in [Guide] Hyper-threading and Windows, explained for real   
    I know it gets used like that a lot, hence why I mentioned that it is a commonly misused term
    I realize it's easier to say, and that to a lot of people, that's the meaning it has, and often that is how languages change and evolve, but I think it has obscured the truth and led to misunderstandings about how the whole system actually works.  I have an issue with someone just saying "the i7 has 8 threads" because - and let's accept your dual meaning of "threads" for the sake of this - they may actually be correct or incorrect, and only further discussion would reveal their true idea or understanding of the system.  If the "right" terms were the only ones ever used, it would remove a lot of ambiguity.
  3. Informative
    Dark_Fuzzy reacted to vanished in [Guide] Hyper-threading and Windows, explained for real   
    This seems to be a commonly misunderstood thing so I'll do my best to shed some light on it.  Keep in mind the following however:
    The purpose of this guide is to define some key terms that are often misused, and explain how threads and hyper-threading works in the context of "Set Affinity" in task manager.  Which checkboxes mean what, how to use it, why it does things, etc. Explaining how a CPU works is not the point of this guide; This information is just provided as background to get everyone on the same page.  It is a simplified explanation of how CPUs work.  To the best of my knowledge it's correct, but it is simplified.  If you want more detail, go to page 3 where there is some good content.  
    Terminology
    Before we can do anything, some terminology is in order.
    Core: This refers to the physical core on your CPU.  You might have 2, or 4, or 6 or some other number.  They are real, physical, and they are there, and with the right equipment, they are clearly visible: Logical Core: This refers to the device exposed to the operating system.  It may or may not represent a physical construct 1:1, but it is something Windows can schedule tasks to execute on.  In a modern i7 for example, you have 4 Cores (4 physical cores), but 8 logical cores, because - due to hyper-threading - each actual core presents 2 logical cores to the system. Thread: This is perhaps the most commonly misunderstood, or at least misused term with regard to this subject.  A thread is not a physical thing, it is not part of hardware, and it does not arise from hardware in any way.  A thread is a software concept, and is a single consecutive series of tasks.  Every running program on your computer consists of one or more threads.  Software can launch or terminate threads as needed, no differently than you open and close applications.  Generally speaking, any time a program is doing 2 or more things at once (ie, has a dialog box open waiting for input, while the main program remains functioning in the background) it is using 2 or more threads.  A program can launch virtually any number of threads, and you can see how many any given program is using in task manager by activating/showing the correct column.  You will find that most programs have more than 10, and some have over 100.  There is no limit to how many threads any CPU can run, but there is a limit to how many can be run simultaneously, and this is where multiple cores and hyper-threading comes in.  It would be incorrect to say a CPU has a certain number of threads.  What you really mean is it has that many logical cores, each one of which can be entirely occupied by one sufficiently demanding thread.  
    Background
    The vast majority of those threads exist because it makes logical sense to do so for the sake of the program design.  Some, however, exist to perform computationally intensive tasks, and these are generally the only threads we care about.  When we say "a program can't use more than 4 cores", it is because the intensive workload is not split up onto more than 4 threads, and since 1 thread can only run on one core at a time, this means the program cannot use more than 4 cores effectively.  Think of it this way - if I tell you to add 3 to 4, and then multiply the result by 7, you can't start multiplying until the addition is done.  This is a very basic example of a serial task - something that cannot be parallelized - something that cannot be split up onto more than 1 thread - onto more than 1 core.  Every thread consists of a great many of these tasks in order, and if the programmer did his or her job correctly, it won't bundle up things that could be done simultaneously by another core.  For example, if I had two employees, I could tell 1 to do this math problem and then fetch the dry cleaning, or I could be smart and tell one to work on the math while the other goes to the cleaner's.  The tasks are unrelated and can be done in parallel, and so they should be put on separate threads so they may be executed simultaneously by separate cores.  One core can run multiple threads (though not simultaneously [*1]), but one thread cannot run on multiple cores.  It may appear to, depending on how Windows schedules it, but if it is loading all cores on the CPU, you will notice that it only loads 1 logical core's worth of percentage on to all of them (ie, a single-threaded application will load all 4 cores in a quad core to 25%, or there abouts).
     
    The thing about an intensive task is it may not actually take effort from the CPU 100% of the time.  Consider the following analogy:
     
    Imagine a store with many customers, and several cashiers that each have one till.  Each customer checking out is like a thread, and each cashier is like a core.  Now what happens when an old lady is rummaging for change?  That cashier - that core - is still occupied with that customer - that thread - but it's not really doing anything, just, waiting.  This happens in real programs as well.  Sometimes a task gets to the CPU, and then realizes, "oh wait, I need something from memory".  In the nanoseconds that it is fetching that, the CPU is occupied but not actually accomplishing anything.  Imagine if that cashier had a second till - the cashier is still only able to work so fast, but at least he/her can make use of his or her "spare time" more effectively.  Now, with a store of customers, several cashiers, and 2 tills per cashier, each cashier can work on checking out a customer, unless they are held up for some reason, at which point that cashier can use his or her other till to start checking out another customer.  This is hyper-threading in a nutshell.  It is not another core, or anything like that - it is just a way that the existing hardware can be used more effectively.[*2]  In theory, 1 core with hyper-threading and 1 core without hyper-threading will perform an identical task in exactly the same amount of time (assuming the cores are the same in every other way), but if faced with 2 tasks, the hyper-threaded core will be faster. Probably not twice as fast, but faster for sure - maybe ~50%, depending on the task, though in theory it could be anywhere from no better to twice as good.
     
    This creates an interesting question though.  When you open task manager and go "Set Affinity", how to you know which of those check boxes map to which physical core?  That's what I will now explain/prove.
     
    (Oh, and as an aside, we now can see why Intel shows an i7 for example as having 4 cores and 8 threads - it is because it can execute 8 intensive threads "simultaneously")
     
    Experiments
    Now that we understand how the CPU and the processes it runs work, we can get into how this relates to Windows.  From my very first i7 back in 2011, I had my own theories, but to be honest I never actually tested them until today.  Luckily I was right about everything I had thought all along.
     
    So how do they map?  Are those 8 checkboxes just saying how many core-equivalents of power you want the task to take up, but have no correlation to an actual core?  Does each one actually refer to a specific core?  And if so, in what order or pattern?  I performed some tests, running a process on just one of those logical cores at a time, and observing which actual core got hotter using HWMonitor.  The results were conclusive and indicated the following mapping is correct. (Note that I count from 0 not 1, as per how task manager does it)
     

     
    Well that's all fine and good, but how do they work (or interfere) with each other?  To determine this, I took a predictable, repeatable and CPU intensive task consisting of 8 threads and ran it on the logical cores indicated in the chart below.  I ran 4 trials in each case and averages the run times (in seconds).  From this we should be able to gain additional insight.
     

     
    I believe these results are also quite conclusive and verify the mapping provided above.  Allow me to explain:
    We notice that on 0, 1, 2, and 3 that the run time is essentially the same (within the margin of error).  This makes sense, since all of these are 1 logical core tests.  I could have continued to test 4, 5, etc but they would all have been the same, since in each case, all it means is the task is allowed to execute on one logical core (ie, execute on one physical core and not take advantage of hyper-threading). We notice that the tests on 0+1 and 2+3 the run times are essentially the same.  We also notice that tests 0+2, 1+2, and 1+3 are also the same as each other, but faster than the 0+1 & 2+3 tests.  This would seem to confirm the mapping above.  If my interpretation is correct, it means that 0+1 was running on core 0 with HT, and the 2+3 test was running on core 1 with HT (both effectively 1 hyper-threaded core), while test 0+2, 1+2, and 1+3 were all running on cores 0 and 1 without HT (effectively a physical dual core).  This is backed up by the run times.  It makes sense the actual dual core should outperform the hyper-threaded single core. To continue, I tried a test on 0+1+2+3.  This is effectively an i3: a dual core with hyper-threading.  We see it get outperformed again by the test on 0+2+4+6, which is effectively an i5: a quad core without hyper-threading. Finally, I tested on all cores just to show the full power of the i7 for reference.  
    What does it all mean?
    It means that the options in task manager do map directly to certain cores, and parts of cores, and there is no mystery.  It means you can basically simulate any kind of processor by setting the affinity in task manager.[*3]  As Luke said, it means there is no difference between task manager's "core 0" and "core 1" - there is no hyper-threading minor core and a parent core or any of that; both core 0 and core 1 just mean run on your actual physical core 0.  But, there is a difference between setting something to 0+1 and to 0+2: 0+1 will make it only use one physical core, taking advantage of hyper-threading when possible, while 0+2 puts the load on two physically separate cores.
     
    Footnotes
    [*1] CPUs are complex things.  A single instruction, and even a series of instructions don't just march one after the next through the chip like the customers in my example.  This is a good analogy in my opinion but it does hide (ignore) much of the complexity.  There are many parts to a CPU - some perform integer math, some do other things, etc. and depending on the CPU, and the code you are running, and how it was compiled, there are various ways in which things are automatically parallelized.  For example, if it appears that an upcoming instruction is unrelated to other things currently being run and the parts of the CPU that would handle it are free, it will jump ahead and run that while using other bits of the CPU for other instructions.  It is because of this complexity that the idea of "simultaneous" execution becomes a bit muddy, but for the purpose of understanding what is going on here, just imagine the example I gave and it should represent what's going on relatively well.
     
    [*2] I must confess, I do not know exactly the bit level "play by play" of what is going on, and I have heard that a core with HT and one without are not physically different, and that they are physically different, but again, for the sake of a general understanding, just consider it a way to use what's already there more effectively, and not as additional hardware, since that becomes hard to distinguish from simply having an additional core.
     
    [3*] OK, obviously there's more to it - IPC, cache size and speed, other differences in architecture, etc.  But what I mean is you could realistically simulate the performance, give or take, of an i3 6100 by disabling some stuff in an i7 6700k
     
    I hope someone finds this useful, and I want this of course to be entirely accurate and correct so if you believe there is a mistake, please let me know, but to the best of my knowledge this is all valid.
     
    Thanks for reading!  
  4. Like
    Dark_Fuzzy reacted to Limepanda911 in New Battlefield is named Battlefield 1 and is Set in World War 1, Releases Oct. 18   
    Love the concept, it's far better than COD IW's shit futuristic Mass Effect, Halo ripoff.
    A few points I would like to make as someone from outside of the US/UK:
    WWI was much more than just trench warfare, there were many theaters and they were extremely varied. There was plenty of all out open warfare, and a lot of it was insanely creative. As far as the name goes, yes BF 1 may not be the best but there is at least a bit of meaning behind it. WW1 truly was the first major "battlefield", it was so vastly bigger than any war prior, and it utterly revolutionized warfare as we know it, so I can see how it sort of fits. I would still prefer something along the lines of Battlefield 1914 though. As a Kiwi I would love to see Gallipoli as a part of the game (although it's unlikely) as it's a battle that we base a lot of our cultural identity around. Anyway, all aboard the hype train. Choo Choo.
    I'm super happy that Dice has decided to go in a different direction to COD.
    I was kind of hoping for a WWII setting but I figure one bonus to this game is that while it looks incredible with this version of the Frostbite engine, the next installation which will probably be WWII will look even better and will truly do the era justice.
    The countdown to October is on 
  5. Agree
    Dark_Fuzzy reacted to Fulgrim in Microsoft confirms that July 29th is the last day for Windows 10 free upgrade - 119$ after that.   
    Windows has always been free, has it not? ( ͡° ͜ʖ ͡°)
     

  6. Funny
    Dark_Fuzzy reacted to GreezyJeezy in FBI could hack anonymous computers, regardless of their physical location.   
    If you don't do anything illegal you have nothing to be worried about. 
  7. Agree
    Dark_Fuzzy reacted to Enderman in [HELP] Doesn't Fit   
    why did you buy an alienware computer
  8. Funny
    Dark_Fuzzy reacted to vanished in [HELP] Doesn't Fit   
    No WAY!  I thought from the pictures this was some random crappy prebuilt with a 200W fire hazard psu and an obsolete cpu... I mean, that is what it looks like.
  9. Agree
    Dark_Fuzzy reacted to TheMissxu in Freesync for 1440p/390X   
    The fact of the matter is that the 8320 came out in 2012.
     
    If you want cheap, you can get a non-K Intel CPU and an H branded motherboard and still get +25% frame rates.
     
    As for your question, you don't *need* freesync, although it's very nice to have. At your budget, I'd advise against it, unless you get a 1080p monitor (specifically the Nixeus Vue 24 inch 1080p Freesync [30Hz to 144Hz] monitor ~$250).
  10. Agree
    Dark_Fuzzy reacted to ShadowCaptain in Apple’s iBooks Store and iTunes Movies shut down by Chinese government   
    Probably had books and movies listed that were not "approved" by the Chinese government

    WHAT A WORLD
  11. Agree
    Dark_Fuzzy reacted to BoredErica in Is "overcloking for free performance upgrade" still valid ?   
    I don't think people would typically need to upgrade their PSU to overclock their CPU.  Most people would probably steer clear of stock coolers even when not overclocking. I also don't see the strong connection between an overclocked processor and having to get a faster GPU. Nobody ever claims the reverse either. You can just take the extra performance and call it a day. The biggest gains would be on a CPU bound game, and in that situation a faster GPU wouldn't really help.
  12. Agree
    Dark_Fuzzy reacted to Enderman in HTC VIVE BURNS YOUR PC?!?!   
    pics for proof?
    i highly doubt anything is burnt and you're just doing this for clickbait
  13. Funny
    Dark_Fuzzy got a reaction from Festive in I7-5820k or AMD FX-8350 for a video editing PC   
    2 intel cores are better than 8 AMD cores. That said yes go for the 5820k.
  14. Funny
    Dark_Fuzzy got a reaction from RustyBaked in I7-5820k or AMD FX-8350 for a video editing PC   
    2 intel cores are better than 8 AMD cores. That said yes go for the 5820k.
  15. Agree
    Dark_Fuzzy reacted to Energycore in I7-5820k or AMD FX-8350 for a video editing PC   
    I'm going to nitpick just a bit.
     
    2 Hyperthreaded intel cores are better than 8 AMD cores. The FX-8000s win out agains pentiums and celerons
  16. Agree
    Dark_Fuzzy reacted to Allshevski in Freesync 165Hz Monitor?   
    Why do you mention CRTs all the time? Am I missing something?
     
  17. Funny
    Dark_Fuzzy got a reaction from VintageSalad in I7-5820k or AMD FX-8350 for a video editing PC   
    2 intel cores are better than 8 AMD cores. That said yes go for the 5820k.
  18. Agree
    Dark_Fuzzy reacted to dalekphalm in Android beats Apple in ditching the headphone port on smartphones   
    I don't understand this - what benefit would there be to Headphones by including an integrated DAC/Amp? The headphones would need to be powered (either via battery - fucking yuck - or by the phone itself - hello low battery - and yes, I realize analog headphones do consume power, but it'll require more power if we need to cram a DAC and/or Amp in there too).
     
    Also, the quality of the DAC and Amp would vary wildly per headphone manufacturer. Cheap headphones are going to sound even shittier, since the manufacturer will now have to cram a DAC/Amp into the price of the headphones.
     
    I'd be much happier if phone manufacturers just put a decent DAC (Some phones do already), and an integrated headphone Amp (Which, honestly, only higher end headphones usually need anyway, low power/cheap ones usually won't benefit from an Amp) into the phone itself.
     
    And I'm sure as hell not replacing my HD598's - and they aren't even "that expensive" compared to some headphones. So I'd have to go out and buy some adapter that is likely going to be even bulkier than if it was just a 3.5mm jack.
     
    I really see no benefit of USB-C/Lightning Audio on a phone, when 3.5mm is the international standard and works just fine. Changing something without a benefit really doesn't sound good to me - and the phones are thin enough that "making it thinner" is simply not a benefit in my eyes.
    Why have 2 USB-C connectors? What else would you use 2 of them for, besides powering and/or tethering the phone + headphones? 1x USB-C + 1x 3.5mm seems like the ideal combination to me.
     
    On other devices, having USB-C as the new standard makes sense, replacing Type B, and possibly Type A as well - I get that. But 2x USB-C ports and no 3.5mm jack on a phone? I don't see the benefit.
  19. Agree
    Dark_Fuzzy reacted to ShadowCaptain in Sinking office/gaming chair?   
    Replace the gas lift cylinder, can get them off amazon etc
  20. Agree
    Dark_Fuzzy reacted to Oshino Shinobu in AMD FX 8350 vs i5-4690   
    i5-4690. Hands down the better option for gaming. 
  21. Agree
    Dark_Fuzzy reacted to Arty in ETA New Mac Pros?   
    TBH, ithink apple just gave up on the desktop side.
     
    and TBH building a pc is better.
     
    (if you must run mac os, hackintosh with better hardware.) 
  22. Agree
    Dark_Fuzzy reacted to dalekphalm in Province of Quebec (Canada) is considering mandating that all new houses to be equiped with an 240V EV charging station   
    Well, government mandate is part of democratic society. Else it would be pure anarchy.
  23. Agree
    Dark_Fuzzy reacted to Fulgrim in what is the different between kailh and cherry mx?   
    Both Kailh and Cherry are good. Cherry just have a better rep since they're made in germany, and cost more. Kailh switches are  carbon copies of Cherry switches, but are sold for a lower price, since they're made in China.
     
    http://imgur.com/a/7ujle
  24. Like
    Dark_Fuzzy reacted to GreezyJeezy in Fury X giveaway   
    The time has come, 26 pages and 630 replies to look through. as of now the contest is over, I will be looking through every single comment, if it catches my eye will right your name and rig down then go through them again and again until there is 3 people left.
     
     
    Thank you all for entering my goal of this was to make someone's day and inspire you all to do nice things for others less fortunate than you. i hope this has at least helped. if you have any further questions feel free to PM me.
     
    again thank you all for entering and good luck to the lucky three of you, I might do something like this again so keep your eyes open! have a nice day eveyone.
  25. Agree
    Dark_Fuzzy reacted to GreezyJeezy in do you like fallout 4?   
    i played FO4 when it first came out, i had maybe 80 hours in it when i quit playing, i tired it again and meh i just cant play it. and i really don't know why it just doesn't feel that good, i think skyrim is better, even fallout new vegas 
×