CS370
If the base register of the Memory Management Unit (MMU) is 0x10 (hexadecimal) and the limit register is 0x24, what is the maximum address (hexadecimal, prefixed with 0x) the CPU may access without generating an exception (trap)?
0x33
partial tlb
1. find match of first part in tag 2. replace page ref with first part
If the page size is 8192, how many bits are required for the page offset?
13
Given a multiprocessor system with 5 cores and an application that is 75% parallel, what is the approximate effective speed-up?
2.5
If the base register of the Memory Management Unit (MMU) is 200 (decimal) and the limit register is 56 (decimal), what is the maximum address (decimal) the CPU may access without generating an exception (trap)?
255
What is a critical section?
A code segment, identified by the programmer, wherein multiple threads access a shared memory location or shared resource.
In a two or three short sentences, describe the unique concerns and solutions when fork()'ing a process with multiple threads. Take the perspective of the author of the fork() system call. Verbose answers will be marked down.
A correct answer will include The essence of the problem is whether or not threads are duplicated with the process Propose a solution either (1) duplicating or (2) not duplicating threads
In one or two sentences (exceptionally verbose answers will be marked down), describe the difference between direct communication and indirect communication as an inter-process communication mechanism?
A correct answer will note that for direct communication (1) A process sends a message to another named process: send(P, msg) (2) A process receives a message from another named a named process: receive(Q, msg) A correct answer will note for indirect communication (1) A message may be sent to a mailbox by any authorized process (2) A message may be received by any process that is authorized to read messages from the mailbox
What is the purpose of the process control block (PCB)?
A data structure used by operating systems to store all the information about a process
What is the purpose of the process control block (PCB)?
A data structure used by the operating systems to store information about a process.
What events might cause a process context switch occur?
A hardware interrupt is handled by the operating system. When the running process makes a system call When the processes time-slice has expired.
What is the purpose of thread-local storage?
A space for variables that are globally accessible in one thread and inaccessible in all others.
what is meant by the term deadlock
A state in which each thread is waiting for some other thread to take action such as sending a message or, more commonly, releasing a lock.
What is meant by the term deadlock?
A state whereby one thread holds a resource and is blocked waiting on a resource held by a second thread, and the second thread is blocked waiting on a resource held by the first thread (possibly indirectly).
What does the term spin lock refer to?
A thread trying to acquire a lock to simply wait in a loop, spin or spinning, while repeatedly checking if the lock is available.
spin-lock
A thread trying to acquire it to simply wait in a loop, spin or spinning, while repeatedly checking if the lock is avaliable
What is happening during a spin-lock?
A thread trying to acquire the lock to simply wait in a loop, spin or spinning, while repeatedly checking if the lock is available.
Which of the following is true regarding operating system design policy?
Addresses what will be done.
A process may transition to the READY state by...
All
What is a process?
An executing program.
what is a system call?
An interface to the services made available by an operating system.
What is an operating system responsible for?
Arbitrating resource requests.
an un-interruptable unit of code is known as
Atomic
Advantage of using threading
Can increase overall program efficiency
What is a process context switch?
Changing the running process from on to another
Which of the following is/are true regarding paging?
Eliminates external fragmentation Eliminates most of the problems of contigous memory allocation
Which of the following scheduling algorithms would be suitable for a computing environment with no user interface?
FCFS or FIFO SJF
a system call is always triggered by hardware
False
What is a process context switch?
Halting the process running on the CPU, saving the PCB, restoring the PCB of a new process and running the new process on the CPU.
Which of the following are components of the process memory space?
Heap. Stack. Data section. Text section.
How are processes organized in linux?
Hierarchically
Which of the following are contained in the process control block (PCB)?
I/O status information Process State Memory Management Information
Which of the following are contained in the process control block (PCB)?
I/O status information. Memory management information. Process state.
What is an appropriate application of Amdahl's Law?
Identifies potential performance gains from adding additional computing cores.
Which of the following might be occurring during the NEW process state? Check all that apply.
Initial memory allocation. Loading of the program into primary storage. Assignment of a process identifier.
If a system is in deadlock are CPU cycles being wasted on spin-locks?
It depends on the implementation of the synchronization mechanism.
What is meant by mutual exclusion?
It is a property of a critical section, guaranteeing only one thread may enter a critical section at a time in the presence of concurrency or parallelism.
what does the ROM-based boot loader do
Loads a more capable boot loader
What does a system fork() function do?
Makes a duplicate of the current process or replaces the entire current process with a new program depending on the specific arguments.
Which of the following is an advantage of using threading, select all that apply.
May improve responsiveness of a program. Leverages multi-processor and multi-core architectures.
Select all answers that are inter-process communication models.
Message Passing Shared Memory
When might a process transition from RUNNING to NEW?
Never.
Which of the following are generic process states?
New. Terminating. Ready. Running.
Can a single core processor provide parallelism?
No.
What does bounded waiting mean?
Once a thread requests entrance into a critical section, there is a limit on the number of distinct threads that may enter the critical section before the request is granted.
In an operating system, each process has its own_____?
Open files Address space and global variables Process Stack
An address generated by a CPU is referred to as
Physical Address
Which of the following methods are used for passing parameters to system calls?
Place values in a table. Push values on the stack. Place values in registers.
When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called?
Race condition
What does live-lock refer to?
Situation in which two or more processes continuously change their states in response to changes in the other process(es) without doing any useful work.
What are the types of parallelism? Check all the apply.
Task parallelism. Data parallelism.
The cp program copies information from one part of the file system to another. Take the perspective that cp is a system program. Describe in three short sentences, why cp should be considered a system program.
There are many perspectives that justify cp as a system program. Two that come to mind are: (1) cp is used by the operating system to move files into a known location to be used later by the operating system (2) cp modifies the file-system, and the operating system is responsible for maintaining the integrity of the file system.
In Chapter 1, the kernel is the focus of discussion for an operating system as a manager of all resources. It states the "kernel is the one process that is always running". From this perspective how could a kernel be implemented as two or more processes?
There are many ways one could answer this question. The one intimated by the question is that resources could be divided among kernel processes, e.g. process one handles all memory requests, while process two handles all disk access requests.
____ occurs when a process spends more time paging than executing
Thrashing
circular waiting is not necessary for deadlock
True
What is a race condition?
Two or more processes trying to write to a shared resource at the same time.
When does a process context switch occur?
When the process requests I/O When the processes time-slice has expired
Can a multi-core processor provide concurrency? Can a multi-core processor provide parallellism?
Yes Yes
Can a deadlock occur when there are only two processes involved?
Yes.
Can a single core processor provide concurrency?
Yes.
Does the following code provide mutual exclusion in a two core system with only one process? while (lock != 0) { } lock = 1; // use critical section or resource lock = 0;
Yes.
int rv = fork(); What are the possible values of rv in the parent process
a strictly positive integer
What is meant by the term paralellism?
all
for priority scheduling algorithms, which of the following statements are true
all processes are not treated equally possible starvation of low priority processes
what is the purpose of a linux kernel module (lkm)
allows functionality to be added or removed while the kernel is running
The major difficulty in designing a layered operating system approach is ____.
appropriately defining the various layers
Interprocess Communication
communication between processes
Absolute code can be generated for
compile time binding
static partitioning
embedded systems
which statement concerning privileged instructions is considered false
executing outside of kernel mode is a recoverable error
mutual exclusion is not a necessary condition for deadlock
false
what is spacial locality?
if an item is referenced, items whose addresses are close will tend to be referenced soon
a message-passing model is
none
which is incorrect
operating systems must provide both cmd line and gui
If the page size is 8192, and a 32-bit virtual addresses 0x00008000. What is the page of the virtual address? What is the physical address of the virtual address?
page:1 address:0x2000
RUNNABLE
process is ready to be executed
c library for threading
pthreads
What does the following program print? int value = 0; int main(void) { value += 5; int pid = fork(); if (pid == 0) { value += 3; } wait(pid); value *= 2; printf("result: %d\n", value); }
result: 16
live-lock
situation in which two or more processes continuously change their states in response to changes in the other processes without doing any useful work
Which of the following are system calls? (Mark all that apply)
sleep() exit()
why are semaphore function calls implemented atomically?
to avoid a race condition
which system call returns the process identifier of a terminated child?
wait();
if a process is blocked, what does that mean
waiting for i/o to be completed
For a single-processor, single core system, there will never be more than one process in the running state
yes
[do worksheet 8]
yes man!
w11
yes man!
w12
yes man!
w13
yes man!
w14
yes man!
int rv = fork(); What are the possible values of rv in the child process
zero