Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

This is a request for the completion of a quiz on the subject of Operating Systems. The quiz will be posted here on September 22st @ 1:00 PM EDT. The expert will have 90 minutes until 2:30 PM EDT to...

1 answer below »
OS QUIZ Guide
Operating Systems Quiz Guidelines
Topics covered
Definitions:
● Operating system, Job, Batch system, Timesharing, Thread, Address space, Process,
Context switch, Uniprogramming, Multiprogramming, Multithreading, Multiprocessing,
Multitasking, Master boot record, System call, User mode, Kernel mode, Starvation,
Atomic operation, Race condition, Mutual exclusion, Critical section, Safety, Liveness,
Fairness, Busy Waiting, Semaphore
Short answers:
● Benefits of concu
ency, Program vs. process, Dispatching loop, Thread state diagram,
Amdahl’s law, Booting sequence, System call sequence, Process creation, Preemptive
vs. nonpreemptive scheduling, FIFO, RR, SJN, SRTF, Multilevel feedback queues,
Lottery scheduling, Independent threads, Cooperating threads, Decision tree, Ways to
implement locks, Semaphores vs. integers, Two uses of semaphore, Code verification
(produce
consumer)
Programming:
● Shell, Write a simple C program (ex. I/O redirection, background processing, spawning
a child process, etc.)
Sample Quiz Questions
● Suppose 40% of a program can be executed in parallel. What is the maximum speedup
for a computer with 4 cores ?
____________________________________________________________________________
__
● How does a thread transition from the running state to the ready state? Check all
answers that apply.
a timer inte
upt a
ives
an I/O request is completed
a thread voluntarily yields
a thread issues an IO request
____________________________________________________________________________
__
● The following is a modified solution for the consumer-producer problem, with a bounded
uffer. Does the solution work?
semaphore nLoadedBuffers = 0;
consumer waits on 0
semaphore nFreeBuffers = N;
producer waits on 0, N >= 2
semaphore mutex = 1;
mutex for the buffe
Producer() {
1. P(nFreeBuffers);
2. P(mutex);
3.
if space is available, put 1 item
in the buffe
4. V(mutex);
5. V(nLoadedBuffers);
}
Consumer() {
6. P(nLoadedBuffers);
7. P(mutex);
8.
if something in the buffer, take
1 item from the buffe
9. V(nFreeBuffers);
10. V(mutex);
}
____________________________________________________________________________
__
● What are some problems with the following lock implementation? Please check all
answers that apply.
Lock::Acquire() {
disable inte
upts }
Lock::Release() {
enable inte
upts }
They are not atomic.
They do not work on multicore machines
They cause busy waiting.
They may prevent the dispatcher loop to regain control.
____________________________________________________________________________
__
● Assuming both threads are running in the same address space sharing variables x and
y, what are the possible final value pairs of x and y? Please check all answers that
apply.
(2,2)
(1,2)
(2,3)
(3,2)
Thread A
x = 1;
x = x + 1;
Thread B
y = 1;
y = x + 1;
____________________________________________________________________________
__
How are semaphores different from integers? check all answers that apply.
Semaphores are accessed through P() and V() operations
Semaphores use only positive integers.
Semaphore operations are atomic.
____________________________________________________________________________
__
● Suppose we have three processes:
Process ID Required CPU
time
A
ival Time
1 400 msec 0 msec
2 300 msec 150 msec
3 200 msec 50 msec
For the FIFO scheduling, what is the turnaround time of process 1?
For the SRTF scheduling, what is the wait time of process 2?
For the SJF scheduling, what is the response time of process 2?
Assume the time slice of 100 msec and a zero context-switching cost. For the
ound-robin scheduling, what is the wait time of process 3? What is the turnaround time
of process 3 ?
____________________________________________________________________________
__
● Write a C program that creates (or spawns) a child process to execute Unix's command
(echo) with a string as the command-line argument.
Answered Same Day Sep 21, 2022

Solution

Ria answered on Sep 22 2022
66 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here