Replies: 1 comment
-
The pthread_setname_np function is not natively supported on Windows in the same way it is on Linux. This is because Windows uses a different threading model, and the pthread.h implementation on Windows (like the one provided by vcpkg) is often a compatibility layer that doesn't fully replicate all POSIX thread features. To set a thread name on Windows, you can use the native Windows API function SetThreadDescription, which is available starting from Windows 10, version 1607. Unfortunately, this is outside the scope of pthread.h. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi vcpkg team,
I am using vcpkg to install pthread.h in an intel windows 11 machine. However, the pthread_setname_np function provided by this package does not actually set the name of the thread.
I understand that the native API for threads is processthreadsapi.h. But I wanted to know if there a way to set the thread name using functions in pthread.h?
Any suggestions/workarounds would be helpful.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions