Linux World
Pages
Home
Programming
Computer Architecture
Tit Bits
Trouble Shoot
Kernel Related
Quizzes
Linux Tips
Follow @Linux_world
Search
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 section
Sema section
Zero section
Muted section
To use a semphore as a mutex, semaphore needs to be initalized to the value of
0
1
-1
2
Which of the following will declare and initialize a mutex
DECLARE_MUTEX
SEMA_INIT_MUTEX
DECLARE_SEMA
MUTEX_CREATE
The value of the mutex when it is locked by a process is
0
1
-1
2
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 fashion
True
False
Depends on kernel version
In case of mutex they are same
The function call to release a semaphore is
up
up_trylock
up_interruptible
All of the above
A reader writer semaphore allows
Multiple 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 optimally
Mutex
Semaphore
Completion
None of the above
Answers :
Answers to Linux Quiz on semaphores
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment