Pages

Linux Quiz on semaphores

Quiz on linux Semaphores

Quiz on linux Semaphores

  1. Race condition occur when

  2. 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

  3. The code that is surrounded by a semaphore is termed as

  4. Critical section
    Sema section
    Zero section
    Muted section

  5. To use a semphore as a mutex, semaphore needs to be initalized to the value of

  6. 0
    1
    -1
    2

  7. Which of the following will declare and initialize a mutex

  8. DECLARE_MUTEX
    SEMA_INIT_MUTEX
    DECLARE_SEMA
    MUTEX_CREATE

  9. The value of the mutex when it is locked by a process is

  10. 0
    1
    -1
    2

  11. To create a semaphore which will attempt to get the lock only once, we can use the function

  12. down()
    down_tryonce()
    down_trylock()
    down_interrupt()

  13. The functions down and down_interruptible work in similar fashion

  14. True
    False
    Depends on kernel version
    In case of mutex they are same

  15. The function call to release a semaphore is

  16. up
    up_trylock
    up_interruptible
    All of the above

  17. A reader writer semaphore allows

  18. Multiple readers or only one writer
    Multiple writers or only one reader
    Multiple readers and writers
    Only one reader or writer

  19. Sending a signal from one thread to other regarding completion of a task/job can be done optimally

  20. Mutex
    Semaphore
    Completion
    None of the above

Answers : Answers to Linux Quiz on semaphores

No comments:

Post a Comment