Does linux user-level thread (pthread) run on multiple cores?

I know that there are:

1) User-level thread - inside the same process address space, but with different stacks.

2) Kernel level thread - inside the kernel memory stack (I guess here).

So, when I create user level threads, the kernels do not know about them [1] . So, how does the kernel know how to schedule different user-level threads in different kernels. This question relates to pthread. If pthread is a user-level thread, how can it work on multiple cores?

Future answer The Seeker read: (thanks to everyone who contributed)

1) Reply to ziffusion (below)

2) David Schwartz answer

3) Link to the training point

+4
source share
1 answer

So, when I create user level threads, the kernels are not aware of them

This is not entirely true. At least not the way you think.

, - BUT -, ( ). , (, ) . ​​ - BUT -, , .

. , . , , .

. Threads Java Python, greenlets Python, goroutines golang - .

Pthreads , pthread . , pthreads - .

, , ​​ . , setcontext() getcontext() , .

+2

Source: https://habr.com/ru/post/1625053/


All Articles