What is the acceleration library model of threads

What is the C ++ streaming extension library streaming model?
1:1 (Kernel-level threading)
N:1 (User-level threading)
M:N (Hybrid threading)

The difference between these models (from the wiki): http://en.wikipedia.org/wiki/Thread_(computing)#Models

I checked the boost site and it did not mention the streaming model used.
I assume this is 1: 1 because it does not provide a function like yield or reschedule , but I'm not sure ...

+5
source share
1 answer

These are native threads, namely, it will use platform threads, at least on Linux, Windows and Mac.

As far as I know, the thread mapping will be 1: 1 with the kernel thread on Windows, Linux, and MAC for each spawned thread.

I am not sure that for other platforms it can be implemented in other ways, but I do not know any implementation of a non-core thread using the boost.thread API.

For custom multi-task "threads", boost.coroutine can be used. There is also a new boost.fiber library, which is almost similar to boost.coroutine, but adds a thread level API (which is a fiber in library terminology) and a user level graphical scheduler.

  • You can find boost.fiber here .
  • Here you can find boost.coroutine here .
+1
source

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


All Articles