Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Saturday October 31 2015, @03:33AM   Printer-friendly
from the A|Journey|Through|the|CPU|Pipeline dept.

It is good for programmers to understand what goes on inside a processor. The CPU is at the heart of our career.

What goes on inside the CPU? How long does it take for one instruction to run? What does it mean when a new CPU has a 12-stage pipeline, or 18-stage pipeline, or even a "deep" 31-stage pipeline?

Programs generally treat the CPU as a black box. Instructions go into the box in order, instructions come out of the box in order, and some processing magic happens inside.

As a programmer, it is useful to learn what happens inside the box. This is especially true if you will be working on tasks like program optimization. If you don't know what is going on inside the CPU, how can you optimize for it?

A primer for those with a less formal background.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1) by Francis on Saturday October 31 2015, @05:26AM

    by Francis (5544) on Saturday October 31 2015, @05:26AM (#256805)

    I didn't mod the post, so I don't know for sure.

    My guess is because it's ignorant to suggest that an understanding of how the processor works is unnecessary. There's more diversity of processor now than there was in the past, but that doesn't mean that it's not a good idea to have some idea what kinds of features processors have and how they work. Yes, you can't optimize for all possible processors, but if you know that the people using the program are going to be using a specialized type of hardware, then you'd be an idiot not to consider that when writing the code.

    And even if you can't count on them to use the same type of hardware, sometimes you do want to using a function that doesn't work very well on a common processor type, even if it's also going to be run on other processors.