Answer: C. Result depends on operation timing. A race occurs when concurrent operations access shared state and timing affects the result.
What is a critical section?
A A process waiting for CPU
B A file system block
C A program's entry point
D Code accessing shared state
Answer: D. Code accessing shared state. A critical section is code that must coordinate access to shared resources.
What does mutual exclusion ensure?
A Every thread runs at once
B No thread can block
C All tasks have equal priority
D Single thread enters protected region
Answer: D. Single thread enters protected region. Mutual exclusion prevents simultaneous access to a protected critical section.
What does a mutex provide?
A A process identifier
B Mutual exclusion lock
C A page replacement rule
D A file allocation method
Answer: B. Mutual exclusion lock. A mutex lock allows one thread at a time to hold protected access.
What is a semaphore?
A Synchronization counter with operations
B A processor scheduling list
C A disk partition label
D A compiled program image
Answer: A. Synchronization counter with operations. A semaphore coordinates access using atomic wait and signal operations on a counter.
What is a binary semaphore's value range?
A Any negative integer
B One through ten
C Zero or one
D Only two and three
Answer: C. Zero or one. A binary semaphore is restricted to two logical states.
What is a condition variable used for?
A Wait for a condition change
B Store process code
C Allocate memory pages
D Select a file name
Answer: A. Wait for a condition change. Condition variables let threads sleep until a condition may have changed.
What is a monitor in concurrency?
A A display device only
B Encapsulated shared state and synchronization
C A memory page table
D A process identifier format
Answer: B. Encapsulated shared state and synchronization. A monitor combines shared data with synchronized operations.
What is a deadlock?
A Every process finishes immediately
B Maximum CPU speed
C Tasks wait in cycle
D Duplicate file names
Answer: C. Tasks wait in cycle. Deadlock prevents progress when tasks wait cyclically for one another's resources.
Which is a necessary deadlock condition?
A Infinite CPU speed
B Circular wait
C Sorted processes
D Unique file names
Answer: B. Circular wait. Circular wait is one of the necessary conditions associated with deadlock.
What does hold and wait mean?
A Release all resources before waiting
B Wait without holding any resource
C Hold resources while requesting more
D Hold no locks ever
Answer: C. Hold resources while requesting more. A process holds at least one resource while waiting for another.
What is preemption in deadlock handling?
A Allow circular waiting
B Increase every priority
C Ignore unavailable resources
D Take resource from a process
Answer: D. Take resource from a process. Preemption forcibly reclaims a resource from a process.
What does deadlock avoidance require?
A No resource requests
B A single CPU only
C Every process identical
D Safe resource allocation decisions
Answer: D. Safe resource allocation decisions. Avoidance grants requests only when the resulting state remains safe.
What is the Banker's algorithm used for?
A Deadlock avoidance
B Page replacement
C File encryption
D CPU cache lookup
Answer: A. Deadlock avoidance. Banker's algorithm checks safe states before granting resource requests.
What is starvation in scheduling?
A Task waits indefinitely for service
B All tasks use equal time
C CPU has no ready work
D A process terminates normally
Answer: A. Task waits indefinitely for service. Starvation occurs when a task is repeatedly denied needed CPU or resources.
What is aging used to reduce?
A Page faults
B Disk fragmentation
C Priority starvation
D Context switch cost
Answer: C. Priority starvation. Aging gradually raises waiting tasks' priority to reduce starvation.
What is priority inversion?
A Higher priority task finishes early
B Every task shares one priority
C A thread is permanently terminated
D Low task blocks higher task
Answer: D. Low task blocks higher task. Priority inversion occurs when a high priority task waits for a resource held by a lower priority task.
What does priority inheritance do?
A Lower every task priority
B Temporarily raise lock holder priority
C Prevent all context switches
D Delete a blocked process
Answer: B. Temporarily raise lock holder priority. Priority inheritance can raise a lock holder's priority to help a waiting high priority task proceed.
What does atomic operation mean?
A Always completes in zero time
B Runs only in kernel mode
C Indivisible from concurrent observers
D Cannot access shared memory
Answer: C. Indivisible from concurrent observers. An atomic operation appears indivisible with respect to concurrent operations.
What does compare and swap do?
A Sort process identifiers
B Conditional atomic value update
C Copy a whole file
D Allocate a page table
Answer: B. Conditional atomic value update. Compare and swap updates a value only if it matches an expected old value.
What is a reader writer lock optimized to allow?
A Multiple readers or one writer
B Multiple writers always
C One reader only, no writer
D No concurrent access ever
Answer: A. Multiple readers or one writer. Reader writer locks allow shared reads but exclusive writing.
What is a spinlock?
A Lock waits by polling
B Lock that writes to disk
C Condition variable with timeout
D A process scheduling class
Answer: A. Lock waits by polling. A spinlock repeatedly checks whether a lock becomes available.
Why can spinlocks waste CPU?
A They allocate too many files
B Waiting thread keeps polling
C They require disk seeks
D They disable every processor
Answer: B. Waiting thread keeps polling. A waiting thread consumes processor cycles while spinning.
What does a barrier synchronization do?
A Select next process
B Release all memory pages
C Move files between folders
D Wait until participants arrive
Answer: D. Wait until participants arrive. A barrier holds participants until the required group reaches it.
What is message passing in concurrent systems?
A Exchange data through messages
B Share every memory variable
C Use one global lock
D Queue stores processes
Answer: A. Exchange data through messages. Message passing coordinates tasks by sending and receiving messages.