D
D
Danil Tunev2018-04-02 18:51:18
C++ / C#
Danil Tunev, 2018-04-02 18:51:18

Speed ​​due to threading in processors using pthread, C?

I read the manual of some professor at the Polytechnic University, they say: for the simultaneous execution of several functions, at the same time, pthread will not work, then I read about multithreading technologies in intel processors, it seemed that only some registers can perform work in parallel. What conclusion do you have about multithreading?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
awesomer, 2018-04-02
@lada-guy

Well, you're not going to run small operations in different threads.
all the same, all registers will be occupied by you most likely for one task entirely.
then another task will load.
it will not be possible to use registers partially for one task and partially for another.
and then there are operating system threads.
so when we are talking about multithreading and these are not microcontrollers without an OS, then you can forget about optimizing at the register level.

R
res2001, 2018-04-02
@res2001

There are several parallel processing technologies. Multithreading is one of them, pthread is the POSIX standard for multithreading support. Windows has its own threading API. Multithreading is perhaps the easiest option to parallelize a program, but there are also cockroaches.
The professor, most likely, had in mind another variant of parallel processing, without context it is impossible to understand.

C
CityCat4, 2018-04-02
@CityCat4

Eee... C language, registers, multithreading, pthread... some mess. In C, of ​​course, you can work with registers - both through register and through asm inserts. But only the multithreading that is available in pthread has nothing to do with register multithreading. Optimization at the level of registers can be done on an asma, on a microcontroller - but in a C program it will all be broken by the compiler :)
pthread and in general it solves a completely different task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question