Operating System Midterm Review
False
Applications compiled on one operating system can be directly executable on other operating systems due to common structure.
Negative
Applications that are designed to work on one operating system will also work on another operating system as long as they provide the same APIs.
None
Assume count is a variable name, which of the following operations is atomic?
The buffer is empty when in == out; the buffer is full when ((in + 1) % BUFFER SIZE) == out;
Assume the shared buffer is implemented as a circular array with two logical pointers: in and out. The variable in points to the next free position in the buffer; out points to the first full position in the buffer. Which of the following is true?
Context Switch
State save of the current process and state restore of a different process
False
Under indirect communication, each process that wants to communicate must explicitly name the recipient or sender of the communication
open() invokes open() system call to get service from operating system
What is the relationship between library call open() and open() system call?
They cannot be attempted from user mode.
What statement concerning privileged instructions is considered false?
The child process runs concurrently with the parent, The child process has a new program loaded into it, The child is a duplicate of the parent.
When a child process is created, which of the following is a possibility in terms of the execution or address space of the child process?
Shared memory segments, Open file descriptors
When a process creates a child process using the fork() system call, which of the following are shared between the parent process and the child process?
False
When fork() is invoked, it is passed a set of flags that determine how much sharing is to take place between the parent and child tasks.
Inside CPU core
Where is the location of L1 cache?
Register set, stacks, private storage area
Which are included in the context of a thread?
CPU, Memory
Which of following are types of resources the operating system allocate?
I/O request, system call, interrupt or time slice expired
Which of the following cases could cause a process being removed from the CPU?
Text section
Which of the following contains the executable code
mutual exclusion
Which of the following critical-section problem's requirements ensures only one process is active in its critical section at a time?
Bounded waiting
Which of the following critical-section problem's requirements limits the amount of time a program will wait before it can enter its critical section?
Application and system programs
Which of the following defines the view of the operating system seen by most users?
flag[j] == false or turn == i
Which of the following indicates that Pi can enter the critical section in Peterson's solution?
Memory Space
Which of the following information is shared when the flag CLONE_VM is set up in the Linux clone() system call?
pthread_attr_init, pthread_create, pthread_join
Which of the following is a function provided by Pthreads API for constructing a multithreaded program?
Thread pools, OpenMP, Intel threading building blocks (TBB)
Which of the following is a method for implicit threading?
Illegal memory access
Which of the following is a synchronous signal?
Terminating a process with specific keystrokes
Which of the following is an asynchronous signal?
KDE or GNOME
Which of the following is not a type of command interpreter?
graphical user interface
Which of the following is not an operating system service?
GB
Which of the following is the denotation of 10243 bytes?
Thread library
A ____ provides an API for creating and managing threads.
command interpreter
A _____ is an example of a systems program.
Rendezvous
A blocking send() and blocking receive() is known as a(n) _________________.
includes information on the process's state
A process control block ____
Completion of an I/O event, Awaiting its turn on the CPU, Newly-admitted process
A process may transition to the Ready state by which of the following actions
Zombie
A process that has terminated, but whose parent has not yet called wait(), is known as a ________ process.
Critical section
A(n) _______ refers to where a process is accessing/updating shared data
Increased throughput, Increased reliability
Advantages of multiprocessor systems
True
Amdahl's Law describes performance gains for applications with both a serial and parallel component.
A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents.
Child processes inherit UNIX ordinary pipes from their parent process because:
Heap Section
Contains memory allocated by malloc()
True
Deferred cancellation is preferred over asynchronous cancellation.
True
External data representation (XDR) is used when transmitting data between different machines using an RPC (remote procedure call).
True
For a single-processor system, there will never be more than one process in the Running state.
0, 1, 2
If a shared global variable x is initialized to 1, two threads execute concurrently statements "x++" and "x--" respectively. What are the possible values of x after the execution of the statements?
PCB0, PCB1
If process P0 is switched to process P1, state for P0 will be saved into _____, and state from _____ will be reloaded?
Heap Section, Shared memory, code section, global data
If the main thread of a process creates a new thread, which of the following are shared between the main thread and the new thread?
150.55.66.77:3500 and 202.28.15.123:80
Imagine that a host with IP address 150.55.66.77 wishes to download a file from the web server at IP address 202.28.15.123. Select a valid socket pair for a connection between this pair of hosts.
A new created thread
In a multithreaded server architecture, which of the following is used to service a new user request?
False
In operating system design, a policy should be defined together with the mechanism.
The number of user-level threads is always more than or equal to that of kernel-level threads.
In the many-to-many multi-threading model, which of following is true regarding the number of user-level threads and the number of kernel-level threads?
It creates an environment within which other programs can do useful work.
In what way is an operating system like a government?
True
Instructions from different processes can be interleaved when interrupts are allowed.
Interrupt
Is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention.
True
One-to-one model provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call.
Affirmative
Mac OS X is a hybrid system consisting of both the Mach microkernel and BSD UNIX.
Message Passing
Microkernels use _____ for communication.
May execute different sequences of instructions within any part of the shared program.
Multiple threads within a process _____.
True
Race conditions can result in corrupted values of shared data.
True
System call interface is the boundary between user programs and operating system services.
False
System calls can be run in either user mode or kernel mode.
Dispatches
The CPU catches the interrupt and ____ it to the interrupt handler
fork()
The Windows CreateProcess() system call creates a new process. What is the equivalent system call in UNIX?
One-to-one
The _____ model maps each user-level thread to one kernel thread.
Ready Queue
The list of processes waiting to execute on a CPU is called a(n)
False
The operating system kernel consists of all system and application programs in a computer.
True
The operating system provides an interface that sits between the hardware and everything else and is easier and safer to program and use than the raw hardware.
False
The producer-consumer problem using a bounded buffer cannot be solved using shared memory.
user mode and kernel mode
The two separate modes of operating in a system are
False
Thread-local storage is inherently equivalent to local variables.
Thread-local storage
To associate each thread created using an implicit technique such as a thread pool, with its unique transaction identifier, we could use ____?
True
Using n threads within a single process is more efficient than using n separate processes because the threads share the same code and data.
True
Virtually all contemporary operating systems support kernel threads.
Several processes access and manipulate the same data concurrently, the outcome of the execution depends on the particular order in which the access takes place
Which of the following is true for race condition?
An I/O-bound process is one that spends more of its time doing I/O than it spends doing computations
Which of the following is true?
Set value of the timer, Turn off interrupts, Access I/O device
Which of the following machine instructions should be run in kernel mode?
Monolithic Structure
Which of the following operating system structure is the one for MS-DOS?
Last in first out
Which of the following principles is used for adding and removing items from a stack?
Running
Which of the following process state will be switched from "ready" state
Kernel
Which of the following programs runs all the time on the computer?
CPU scheduler
Which of the following selects from among the processes that are in the ready queue to execute and allocate the CPU to one of them?
Shared memory is typically faster than message passing.
Which of the following statements is true?
hard-disk drive
Which of the following storage is nonvolatile?
exec().
Which of the following system calls is used to have a new program loaded into the new process's memory space?
int turn, boolean flag[2]
Which of the following variables are shared between the processes in Peterson's solution?
Peterson's algorithm
_____ is not a technique used for handling critical sections in operating system kernels.
Ensuring there is a sufficient number of cores
_____ is not considered a challenge when designing applications for multicore systems.
System Calls
_____ provide(s) an interface to the services provided by an operating system.
False
iOS is open source, Android is closed source.