FINAL EXAM 2025-2026 Most Recent Version
Comprehensive 150 Questions and Verified
Answers Accurate Solutions Already Graded A+
Get it 100% Correct
a collection of statements - CORRECT ANSWER: program
A CPU repeatedly checks the status of a device - CORRECT ANSWER: polling
A device controller notifies the corresponding driver when the device is available -
CORRECT ANSWER: interrupt-driver I/O
A disk is an example of ... - CORRECT ANSWER: block device
A factory is producing pepper and salt shakers. Use lock(s) and condition variable(s) to
write a procedure PepperShakerArrvies() that is called whenever a pepper shaker
(thread) is produced. Use lock(s) and condition variable(s) to write another procedure
SaltShakerArrives() that is called whenever a salt shaker (thread) is produced. As soon
as one pepper shaker and one salt shaker are available, one of the threads should call
PackShakers() (you don't need to implement PackShakers()); one thread is returned
from PepperShakerArrives() and one thread is returned from SaltShakerArrives(). -
CORRECT ANSWER: int pepperCounter = 0;
int saltCounter = 0;
Lock lock = new reentrantLock();
Condition SaltandPepper = lock.newCondition();
PepperShakerArrives(){
lock.Acquire();
pepperCounter++;
,return(lock);
}
SaltShaker Arrives(){
lock.acquire();
saltCounter++;
return(lock);
}
if(saltCounter >= 1 && pepperCounter >= 1){
PackShakers()
}
A factory is producing socks. Use lock(s) and condition variables(s) to write a procedure
ASockIsProduced(), which is called whenever a sock (thread) is produced. As soon as
two socks are available, one thread should call PackAPair() (you don't need to
implement PackAPair()), and two threads should return from ASockIsProduced(). -
CORRECT ANSWER: int socksProduced = 0;
Lock lock = new ReentrantLock();
Condition socksAvailable = lock.newCondition();
ASockIsProduced(){
lock.Acquire();
socksProduced++;
if(socksProduced == 2){
socksAvailable.broadcast(&lock);
lock.PackPair();
lock.Release();
, }
return lock;
}
A general OS function - CORRECT ANSWER: standard services
A keyboard is an example of ... - CORRECT ANSWER: character device
A mechanism to protect one app from crashing another app - CORRECT ANSWER:
address space
A piece of code that only one thread can execute at a time - CORRECT ANSWER:
Critical Section
A recipe is an analogy of? - CORRECT ANSWER: A program
A referenced page is not in memory - CORRECT ANSWER: page fault
a sequential execution system - CORRECT ANSWER: thread
A unit of processing - CORRECT ANSWER: job
A unit of transfer - CORRECT ANSWER: packet
Ad hoc file system check - CORRECT ANSWER: fsck