Home » Linux » Programming » pthreads » Quiz » Quiz on pthread basics Hasan Basri 2:38 PM 0 comments Linux Programming pthreads Quiz Quiz on pthread basics Pthreads Basics Quiz Pthreads Basics QuizA quiz on basics of pthreads 1. Which header file needs to be used for pthread programming ? pthreads.hpthread.hp_thread.hposix.h Pthreads are not useful in uniprocessor systems False TrueDepends on the compilerDepends on the processor What are the flags that are passed while compiling a pthread program using gcc -pthread-lpthread-gccpthread-thread Among the arguments passed to pthread API pthread_create the final argument, is.Attributes of the threadName of the threadData being passed to the threadThread id The data type used for storing the thread id is pthreadpthread_tp_thread_tpthread_id Which of the following APIs can be used for synchronization between threads pthread_exitpthread_cancelpthread_selfpthread_join To create a detachable thread which of the following structures needs to be modified pthread_attr_tpthread_tpthread_attributeattribute_t pthread_self returns The thread idThe thread attributeThread dataThread running time Two threads can be compared using the API compare_pthreadspthread_equalpthread_compareequal_pthread pthread_create(&threads_id, NULL, Hello_world, NULL); creates a threadCalled Hello_world with default attributesCalled Hello_world with all attributes set to NULLCalled Hello with default attributesCalled Hello with all attributes set to NULL Answers the quiz are available at : Answers to pthreads basic quiz Share: Facebook Twitter Google+ StumbleUpon Digg Delicious LinkedIn Reddit Technorati
0 comments:
Post a Comment