Home » Linux » Quiz » Linux Quiz on semaphores Hasan Basri 10:55 PM 0 comments Linux Quiz Linux Quiz on semaphores Quiz on linux Semaphores Quiz on linux Semaphores Race condition occur when There is uncontrolled access to data There is uncontrolled access to shared data Every time kernel accesses user space data Every time user communicates with kernel The code that is surrounded by a semaphore is termed as Critical sectionSema sectionZero sectionMuted section To use a semphore as a mutex, semaphore needs to be initalized to the value of 01-12 Which of the following will declare and initialize a mutex DECLARE_MUTEXSEMA_INIT_MUTEXDECLARE_SEMAMUTEX_CREATE The value of the mutex when it is locked by a process is 01-12 To create a semaphore which will attempt to get the lock only once, we can use the function down()down_tryonce()down_trylock()down_interrupt() The functions down and down_interruptible work in similar fashionTrueFalseDepends on kernel versionIn case of mutex they are same The function call to release a semaphore is upup_trylockup_interruptibleAll of the above A reader writer semaphore allowsMultiple readers or only one writer Multiple writers or only one reader Multiple readers and writers Only one reader or writer Sending a signal from one thread to other regarding completion of a task/job can be done optimallyMutexSemaphoreCompletionNone of the above Answers : Answers to Linux Quiz on semaphores Share: Facebook Twitter Google+ StumbleUpon Digg Delicious LinkedIn Reddit Technorati
0 comments:
Post a Comment