I need to control CPU affinity for all the pthreads in my process. Some pthreads are created by third-party libraries. Is there a way to enumerate the pthread_t of all existing pthreads in the process so that I can call pthread_setaffinity_np() on them?
Asked
Active
Viewed 2,486 times
6
-
How portable does it have to be ? – cnicutar Dec 08 '12 at 16:41
-
4your question seems to be a duplicate of this: http://stackoverflow.com/questions/3475750/posix-api-call-to-list-all-the-pthreads-running-in-a-process – Bug Killer Dec 08 '12 at 20:40
-
1Possible duplicate of [POSIX API call to list all the pthreads running in a process](https://stackoverflow.com/questions/3475750/posix-api-call-to-list-all-the-pthreads-running-in-a-process) – ArturFH Jun 13 '17 at 15:09