1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPU I have a few questions about CPU/Processors

Discussion in 'Hardware' started by Xcellenye, 1 Oct 2011.

  1. Xcellenye

    Xcellenye What's a Dremel?

    Joined:
    30 Sep 2011
    Posts:
    34
    Likes Received:
    0
    Hi, as you can see im new, there is some excellent stiff on the bit tech forum, found out about this through custom pc mag and glad cause like i said some interseting things on here and the members, from what ive seen so far are helpful and now the questions...

    What is a thread in a CPU? what does a thread do?

    what is an execution core?

    what is the difference between x86 and ARM?

    and what is cache?

    sorry im new and learning (i hope) so i don't know everything
     
  2. Taniniver

    Taniniver Minimodder

    Joined:
    24 Aug 2010
    Posts:
    205
    Likes Received:
    15
    OK, here is a reasonable (I hope!) summary - not too detailed.

    A thread is simply a series of instructions being executed to achieve something. In the classic approach to writing a program, there is only a single thread - one series of instructions being executed one after another until the desired result is achieved, be that decoding video frames to send them to your screen, or creating an archive, or whatever. More modern programs tend to be multi-threaded, to take advantage of processors with more than one core. If you have a 4-core processor and are trying to, for example, use it to play a game, and that game is not multi-threaded, then it will only be using one of the four cores, the other three will be sat idle and 3/4 of your CPU's potential processing power is going unused, so your game runs much slower than it could. To take advantage of multiple CPU cores, the game developers can write the game in a multi-threaded fashion, where several threads are doing different things at the same time to achieve the final result. In the case of a game, you might have one thread doing the calculations to do with rendering the graphics, another handling the audio, yet another handling the enemy AI, one handling the physics, etc... This is difficult to do properly though - not everything takes the same time to process, so it's no good if your audio processing is done but you are still waiting on the graphics for example. Getting the timing right to avoid one thread waiting on the others finishing before it can do the next thing it needs to do is a tricky task, and not everything lends itself well to being split up into multiple threads.

    By execution core I assume you mean the cores of a CPU, like an Intel Core i5 2500K being 4-core for example. In essence, each CPU core is almost like an entire old-style single core CPU in its own right - it can churn through a series of instructions, access memory, etc... An old CPU like a Pentium 4 only had a single core, so it could only be working on one thing at a time. A dual-core CPU appears to your operating system as if the system actually had two CPUs, so it can do two things at one - etc... up to the limit of the number of cores. When you have multiple CPU cores available they could be running different programs (your email could be downloading whilst you watch a video for example) or they could be running different threads from the same program, or even a combination of those things.

    Difference between x86 and ARM? Very very technical, so I'll be brief. They offer different instructions a program can use to achieve what it wants to do. All processors will offer certain basic instructions, things like adding and subtracting numbers, but they also offer much more advanced functions that can be accomplished with a single instruction. A program is always compiled for a specific processor architecture, so a program compiled for an x86 CPU will not run on an ARM one and visa-versa, though the developer may choose to make versions available for different processor types. In general x86 offers more complex and powerful instructions, and x86 processors also tend to have more cores and faster clock speeds, so they can do a lot of processing work. On the flip side, ARM processors are generally simpler and slower, but they operate with MUCH less power, so are more suitable for mobile devices.

    Cache is a specialised type of memory, located on the processor die, that is very fast for the processor to access. You know that a program has to be loaded into RAM for it to be executed? Well, whilst your processor is actively working on a specific part of the program or a small data set it gets stored in the processor cache too/instead. There are multiple levels of cache in a modern CPU - level 1 cache is small, extremely fast, and very close to the processor core. By modern storage standards level 1 cache is tiny - it may only be about 32 kilobytes in size. It has to be very close to the CPU core (physically) to allow for fast access times - the limiting factor being the speed of electricity travelling through the processor. Level 2 cache is bigger but slower, and level 3 bigger and slower still - each stage gets further away from the processor core. "Slow" in this context is relative though - even level 3 cache is still much faster to access than RAM, and RAM only takes about 70 nanoseconds to access. On a modern CPU, the level 3 cache (if it has one, not all processors do) is often shared between all the CPU cores. This is useful if you have multiple threads across the cores working on the same set of data. Archiving is the classic example - a processor with a nice big level 3 cache will be much faster at compressing data into an archive (when using a multi-threaded archive program) than one with a smaller cache or even no level 3 cache at all. This only really scratches the surface of what cache is and how it works though - it really is extremely complex :)

    If all that was a bit too detailed, consider a real-world analogy. You are doing some work and the data is stored on paper in files. The CPU core is your brain. The level 1 cache is what you are actually thinking about and reading right at that moment. The level 2 cache is one folder that is open right in front of you on the desk. The level 3 cache is a whole load of other files all over the surface of your desk. The RAM is files stored in filing cabinets in the same room. And the (mechanical) hard drive, if we are to preserve this very rough analogy with any semblance of accuracy, is files stored in a warehouse about 500 metres away down the street ;)

    If you want to learn more about any of these subjects I could find some suitable articles online, though it looks like even the Wikipedia article on the subject of CPU cache is full of much more complex details than I gave there!
     
  3. Magizi

    Magizi What's a Dremel?

    Joined:
    14 Aug 2011
    Posts:
    8
    Likes Received:
    0
    very interesting. did you learn all of those on the web or through school?
     
  4. Nazata

    Nazata What's a Dremel?

    Joined:
    2 Sep 2011
    Posts:
    160
    Likes Received:
    6
    +1 to Taniniver for a post excellently explaining a reasonably difficult area of computers...
    Learned a couple of things myself :)
     
  5. Taniniver

    Taniniver Minimodder

    Joined:
    24 Aug 2010
    Posts:
    205
    Likes Received:
    15
    A bit of both Magizi - Computing A level and Computer Science degree contributed some, then a general interest in PC hardware filled out the rest :)
     
  6. matt_lumley

    matt_lumley You're only supposed to...

    Joined:
    28 Apr 2010
    Posts:
    1,000
    Likes Received:
    31
    Its surprising how much you pick up just tinkering with PCs and using this website, my knowledge has improved no end thanks to many a user of this forum (including the above post...very useful and informative). +rep
     

Share This Page