Is there a thread, pipeline and core relationship?

Asked

Viewed 209 times

3

Is there any relationship between these elements (thread, pipeline and core of the CPU)?

I saw that the pipeline helps a lot when you need to perform many tasks, thus making it easier to harness the processing power and can increase the gain of up to 4x more (comparing without the pipeline)

The segmentation of instructions is a hardware technique that allows the CPU perform the search for one or more instructions beyond the next to be executed - Wikipedia

Thread is the task a given program performs. Thread execution, also known as line or thread execution, is a way for a process to divide itself into two or more tasks which can be performed competitively. - Wikipedia

In computing, the kernel or kernel is the central component of the operation of most computers; it serves as a bridge between applications and actual data processing done at hardware level. - Wikipedia

After seeing this concept in computer architecture, I automatically ended up relating with threads and CPU core, however, I do not know if they are totally different things or if they have some connection.

If they have any relationship, what would they be?

Source - Page 27 - 28 (Increasing Pipeline Performance, Pipeline Limitations)

  • That pipeline is talking?

  • What do you mean? (I haven’t studied this concept in depth, so I don’t know how to answer, I’m going to put the handout page in order to get better)

  • Rodrigo, what is the purpose of reading? Faculty? Contests or to learn new concepts? If it goes to college and contests, the tests and the teachers, they are literal, copy and paste what is in the books, generally use as a base the authors: Tanenbaum or Patterson, Hennessy

  • @Luiz Augusto Knowledge, and also to know what I am doing with my code, etc.../

1 answer

1


The question is (or was) a little vague, but I would say that there is no relation between these concepts, at least not with these terms.

Pipeline is something internal to the processor, generally you or your code do not need to know that it exists, how it works, or what will happen to it, is transparent and helps your code run faster for a matter of engineering the product you are using, is an implementation detail that helps you and that’s it, if you never hear anything about it it doesn’t change anything unless you’re doing something very low level that demands very high performance, but anyway you can’t manipulate it, at most create something that better explore the pipeline, in general only those who make a code generator for compiler or some very specific library need to know this.

Of course, the moment you study architecture will know this, it is a useful knowledge when it is not only decorate and can help make better decisions in certain scenarios of programming, but stops there what is useful to most people.

Core is a little important term outside the hardware area, for programming to all effects each core is a different processor. That term seems almost random there.

Thread is a concept of the operating system that can be exposed for its application and in general the hardware does not even have knowledge. It is a way to maintain a state of shared memory between processing lines. Some people might call this processing line pipeline, an equal term but that has nothing to do with the term used in computer architecture. The only relationship that thread has with core is that the fact that there is more than one is possible to make the same process have more than one execution line and so can use more than one core, although if you had multiple processors with only one core the same would happen, so talking about core here is circumstantial.

Incidentally thread can (but does not guarantee) let the response to an execution request happen before (some people rate it to be faster) because the processing (something broad) can happen at the same time.

Incidentally pipeline processor may (but does not guarantee) that some instructions that will be executed there (something specific) occur at the same time and this can respond faster than normal, which ends up being considered faster.

So they both get a similar gain in completely different forms. If it is this relationship you are looking for, then have it, both are completely distinct, unrelated things, which perform in very different ways, which are used for general purposes which can be considered the same (let the execution as quickly as possible)relationship is the ultimate purpose.

So they have a similar ratio to decrease the weight of a car or increase engine power or use a more sticky tire, it has nothing to do with each other, but they all make the car go faster if it does right.

  • He clarified a lot of things that left me in doubt, I thank him for the answer. In fact, as I have handled very little programming, he generated this doubt. About architecture, isn’t it good to go all the way then in order to get more knowledge? Or it’s better to stop here, remembering that my goal is to get out there and understand how it works, and not just copy and paste the same code in the past/present.

  • 1

    `well yes, but if you’re not going to work with hardware it’s only basic understanding. Will you build processors? If you’re not going to need to understand the pipeline but only, bigger details about it only make sense to those who will build processor. A middle ground is whether it will build backend of compilers or something similar because you need to understand a little more the pipeline. The big problem of building knowledge is not understanding what each thing is for, so you don’t even know what it’s for and what it’s not for, and you’re probably doing the same thing as copying and pasting. Learn and then see if it fits.

  • 2

    "My goal is to get out there and understand how it works."Reading this, I remembered this excerpt from Maniero himself: "Every programmer should learn how a compiler works. Even though he will never write one. There is a huge difference in the quality of the programmer who understands this (and other subjects) and what he does not understand. You don’t need to be a deep connoisseur, but you need to know what it’s like to use your everyday tools better. But you need to avoid the cult position.":How is a compiler made?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.