Professional Documents
Culture Documents
All Quizzes Search Buddy
All Quizzes Search Buddy
The structure of an operating system consists of interface, application, and file management system
True
Vv False
True
y @ False
Multiprocessing
Multiuser
Multithreading
ve) Multitasking
.. is the physical equipment. Software is the collection of programs that allows the hardware to do its job
Computer architecture
Computer Software
Computer Middleware
Ye) Memory manager, process manager, device manager and file manager
For FIFO (First In First Out) job scheduling and no priorities, the average waiting time (in sec) is
10
7.5
vie) 5
the process ID
Y True
False
y (© True
False
The state transition from WAITING to READY happens when a process is dispatched
from by the scheduler
True
y © False
Question 1 1/1 point
Relocating
Suspending
Blocking
Sv Swapping
A is a unit of activity characterized by the execution of a sequence of instructions, a current state, and an associated set of system resources.
Answer: process 4
When one process spawns another, the spawned process is referred to as the..........
So child process
trap process 0
stack process O
parent process
True
y (©) False
We can characterize the behavior of an individual process by listing the sequence of instructions, referred to as a , that executes for that process.
Answer: trace ¥
The process control block is the least important data structure in an OS.
True
y @) False
The portion of the operating system that selects the next process to run is called the
PSW
ve) dispatcher
trace
Question 1 1/1 point
The OS performs a protection function to prevent unwanted interference between processes with respect to resources.
y (@) True
False
True
y (@) False
vy (@) True
False
y (©) True
False
y (@) True
False
The traditional approach of a single thread of execution per process, in which the concept of a thread is not recognized, is referredtoasa__
task
lightweight process
resource
The principal disadvantage of the approach is that the transfer of control from one thread to another within the same process requires a mode switch to the kernel.
VAX
LwP
ULT
ye) KLT
The _ is the collection of program, data, stack, and attributes defined in the process control block.
A way to overcome the problem of blocking threads is to use a technology referred to as . which converts a blocking system call into a nonblocking system call.
Answer: jacketing vy
It is possible in a single-processor system to not only interleave the execution of multiple processes but also to overlap them
True
v (@) False
True
v (@) False
When processes cooperate by communication, the various processes participate in a common effort that links all of the processes.
vy (@) True
False
A situation in which a runnable process is overlooked indefinitely by the scheduler, although it is able to proceed, is
mutual exclusion
ve) Starvation
livelock
deadlock
A semaphore that does not specify the order in which processes are removed from the queue is a semaphore.
general
binary
strong
vie) weak
arises in three different contexts: multiple applications, structured applications, and operating system structure. (Hint: Write in small letters)
Answer: concurrency ¥
In the case of competing processes three control problems must be faced: mutual exclusion, deadlock, and . (Hint: Write in small letters)
Answer: starvation ¥
The term refers to a technique in which a process can do nothing until it gets
permission to enter its critical section but continues to execute an instruction or set of
instructions that tests the appropriate variable to gain entrance
data type.
Suppose a program has three threads Thread1, Thread2, and Thread3, and a shared counter, count, as shown below:
What are the possible outputs of this program? Hint: there is more than one answer, and you must provide them all.
1. Ali cannot plant a seed unless at least one empty hole exists, but Ali does not care how far John gets ahead of Ali.
2. Adam cannot fill a hole unless at least one hole exists in which Ali has planted a seed, but the hole has not yet been filled. Adam does not care how far
Ali gets ahead of Adam.
3. Adam does care that John does not get more than MAX holes ahead of Adam. Thus, if there are MAX unfilled holes, John has to wait.
4. There is only one shovel with which both John and Adam need to dig and fill the holes, respectively.
1 John()
2 { while (1) {
3 wait(--—-—--);
4 wait(unfilled);
5 ildig
6 signal(sced);
7 signal(shovel);
8}
9}
~) seed
O filled
shovel
seed
~) shovel
@ ai
() unfilled
1 Adam (){
2. while (1) {
3 wait(fill);
4 wait(shovel);
5 if fill
6 signal(-—-----);
7 signal(shovel);
8 }
9}
shovel
unfilled
fill
nT
True
False
True
False
True
False
True
False
doting NS
Sdofine LEFT {i +N 1) %N
Sdetine RIGHT (i+ 1) %N
pthroad_t philosopher{N];
som_t forks{N];
void *eat_think(veid *arg)(
inti *(int*}arg:
while (1){
printf(*Phiosopher *%d is thinking\a’,
usleep(1000009);
(Aforks[LEFT);
sem _wait{&forks[RIGHT]);
printf(’Phiosopher id is eating\a’, 1);
usloap(1000200);
som_post(Aforks[LEFT]};
s0m_post(forks[RIGHT]);
What is the purpose of the sem_init function call in the main function?
1/1 point
What is the purpose of the sem_post function calls in the eat_think function?
(© Te signal that a philosopher has not finished thinking and is not ready to eat.
© Te signal that a philosopher is ready to eat and needs to acquire the forks.
In UNIX: A software mechanism that informs a process of the occurrence of asynchronous events is called
~) pipes
_) Semaphores
_) messages
) signals
) True
1/1 point
In LINUX, RT signals differ from standard UNIX signals in
3-Mbyte
4-Mbyte
ye) 1-Mbyte
2-Mbyte
Question 2 2 / 2 points
What was the size of the free block just before it was partitioned by X?
3-Mbyte
5-Mbyte
1-Mbyte
vie) 7-Mbyte
relocation
external fragmentation
compaction
True
vy (©) False
True
y ©) False
Consider a simple paging system with the following parameters: 264 bytes of physical memory, page size of 216 bytes, and 232 pages of
logical address space.
20 bits
32 bits
vie) 48 bits
26 bits
212 bytes
vie) 216 bytes
214 bytes
229 bytes
20 bits
RY eae)
Consider a simple segmentation system that has the following segment table:
0 6600 148
1 1752 622
2 2220 398
3 1000 104
For a logical address of <2,556> as <segment #, offset>, what is the physical address using simple segmentation?
1294
245
v © Segment Fault
223
Question 5 @ / 2 points
For a logical address of <1,530> as <segment #, offset>, what is the physical address using simple segmentation?
1256
b& 2282
No physical address will be generated , segment fault error
L=— 2282
eae esti 4
Assume dynamic relocation is performed with a linear page table . Assume the address space size is 16KB, physical memory size is
64KB, and page size is 256 bytes. In a PTE, the high-order bit is the VALID bit. If the bit is 1, the rest of the entry is the PFN (Page
Frame Number). If the bit is 0, the page is not valid. The following are the contents of the page table (from entry 0 down to the max
size):
0x80000007
0x80000051
0x00000000
0x00000000
0x800000a1
0x800000d1
0x00000000
0x80000018
0x80000075
0x800000c2
0x8000000f
0x8000002c
0x80000015
0x8000004b
0x800000f1
0x8000006d
0x800000b0
0x800000d8
0x80000041
0x800000a5
0x800000ac
0x8000006f
0x8000002a
0x800000c7
0x800000e6
0x80000073
0x00000000
Invalid
C— Oxc75e
0x775e
Oxd85e
Invalid
0x51940
L =» 0x7340
0xa540