Difference between C ++ 11 between <thread> get_id () and native_handle ()

What is the difference between C ++ 11 functions get_id()and native_handle()?

In the test program I created, they return the same value intfor their threads, so I don't know what the difference is.

I am using GCC 4.8.1 on Windows.

+4
source share
1 answer

From this link :

get_id returns stream id

and

native_handle returns the base thread descriptor defined by the implementation

The stream identifier returned get_idmust be a class ( std::thread::id) and not a number or another specific platform descriptor.

native_handle , , , . Windows HANDLE, CreateThread, POSIX pthread_t pthread_create.

+5

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


All Articles