Anwers to the pthreads basics quiz
Here are the answer to the quiz on pthread basics
1. Which header file needs to be used for pthread programming ?
2.Pthreads are not useful in uniprocessor systems
3. What are the flags that are passed while compiling a pthread program using gcc ?
4. Among the arguments passed to pthread API pthread_create the final argument, is.
Ans: Data being passed to the thread
5. The data type used for storing the thread id is
6. Which of the following APIs can be used for synchronization between threads
7. To create a detachable thread which of the following structures needs to be modified
8. pthread_self returns
Ans: The thread id
9.Two threads can be compared using the API
10.pthread_create(&threads_id, NULL, Hello_world, NULL); creates a thread
Ans:Called Hello_world with default attributes