This program creates five threads, each executing the function TaskCode that prints the unique number of this thread to standard output.
My question is how can I create and display the attributes of the threads?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
pthread_attr_init(3)manpage includes a sample program showing how to retrieve the attributes available to threads. Note that the APIs do not allow specifying thepthread_tthread identifier and thus can only return the attributes of the current thread: