AIT 542 Midterm Study Guide

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

A process with 10 threads runs on a system where the user not the kernel handles all thread management. How many of the threads can continue to run if one f them blocks?

0

If, on a virtual Windows machine, a user creates and saves 10 new files, how many of these new files are add as new files to what already appears on the hosting system:

0

Suppose page a is 2 KB (2048 bytes). What is the offset to the first word on page a?

0

Suppose you have the virtual address shown below. You also know that the base register value is 0C000020 and the limit register value is 0C008020. Show in the table below what the real (physical) address for each virtual address is and whether or not the address is good (Ok to use) or bad (will cause a trap).

00000004 becomes 0C000024 address is good 00009500 becomes 0C009520 address is bad (is > 0C008020) 00030220 becomes 0C030240 address is bad (is > 0C008020) 00000876 becomes 0C000896 address is good

Number of pages of a process that may appear in a frame of memory at a time:

1

What round robin scheduling degrades to if timeslices become very long?

FIFO

Fill in the blanks in the table below asking about scheduling policies: indicate whether the policy is pre-emptive or not, and for the 'kinds of jobs' part, one example is sufficient in each case.

FIFO is not pre-emptive, is favorable to long running jobs, is unfavorable for short jobs. Round robin is pre-emptive, is favorable for short running jobs, is unfavorable for long running or I/O intensive jobs.

Program instructions are always directly read from main memory to be executed by CPU.

False

The ISO/OSI network model, useful for understanding network design, has five layers.

False

The use of fixed partitions of unequal size eliminates the problem of internal fragmentation.

False

True or false: A runnable process will never be swapped out while it remains runnable.

False

True or false: Adding more frames of memory always improves page fault behavior

False

True or false: All resources managed by a computer are hardware resources.

False

True or false: An OS only works when directly controlling real hardware.

False

True or false: Disabling mutual exclusion in an OS is a normal and widely used way to prevent deadlock.

False

True or false: Dynamic address translation does not work on systems with a cache memory.

False

True or false: In providing a mutual exclusion mechanism, we assume that fast running process do not cause problems.

False

True or false: Paging space in a virtual memory system should always be set to the same size as the amount of physical memory in the system.

False

True or false: Semaphores fail to work as a synchronization mechanism on systems with multiple CPUs and one shared memory.

False

True or false: Swapping a process out of memory moves part of or all the process.

False

Virtual memory requires that all of a program be loaded into memory before the program can run.

False

Assume we are dealing with a system that places processes in memory following a dynamic partitioning scheme. At some point in time we have just loaded a process that needed 49 Kb, and memory is as depicted below. Shaded regions are full, blanks are holes (with sizes in kBytes as indicated); the most darkly shaded region is the process most recently loaded. Show, on the memory diagram above, where a new process requiring 32 Kb of memory will be positioned if the placement policy is: (i) Best fit, (ii) first fit, (iii) worst fit, (iv) next fit.

First fit places process in 34 Kbyte partition Best fit places process in 33 Kbyte partition Next fit places process in 40 Kbyte partition Worst fit places process in 50 Kbyte partition

Compare fixed and dynamic partitioning schemes for their fragmentation issue?

Fixed partitioning has internal fragmentation whereas dynamic partitioning has external fragmentation.

To create a new process in any UNIX-style system, first use a ____ system call.

Fork

Briefly explain what makes a master/slave multiprocessor different from asymmetric multiprocessor

In master/save, only the master can perform system call code: every process needing to perform a system call, no matter that CPU it runs on, must wait for the master CPU to perform the system call. Since this is a simple extension of normal single-processor systems, master/save systems are easier to build. In a symmetric multiprocessor, any processor can perform a system call, so there is no bottleneck at master CPU. Synchronization across processors is much harder with symmetric multiprocessors.

What is the main drawback of virtual address and how can we solve it? (Hint: Recall its worst-case analysis. There is a slide describing this. I emphasized the slide and said the slide is very important to understand.)

In the worst case, it requires two memory access, one for page mapping and the other for real data/instruction access. We use translation lookaside buffer (TLB) for the page mapping.

Fixed partition allocation schemes suffer from ___fragmentation.

Internal

Peripheral devices may be operated using a polling technique, or using:____________________.

Interrupts

Part of OS always resident in memory:

Kernal

UNIX/Linux command to send a signal to another process:

Kill (also signal)

An executable image of a program suitable for loadi

Load module

A synchronization technique that works in all combinations of single/multiple CPUs with single/multiple memories:

Message Passing

Data structure where OS keeps administrative & status information about a process

Process Control Block (PCB)

Where / how does the operating system keep track of detail for each process?

Process control block

The process control block (PCB) contains i) processor (CPU) state information, ii) process control information, and iii) user area. What is processor state information? Why do we need processor state information in PCB?

Processor state information has a "snapshot" of CPU, e.g., registers. It is used when a process resumes its task.

The set of pages a process present in real memory is the _____ set.

Resident

The time between a user submitting a request and the start of some response is:

Response Time

The states (or status) of a process include:

Running Blocking Swapped Not running

Of the two methods we saw for controlling access to critical sections and synchronizing processes, only one works universally - the other works only on a small subset of possible configurations.

Semaphores and message passing Message passing works universally Semaphores do not work with multithreaded systems because each system has its own memory Semaphores would work if multiprocess systems shared memory

What does the term cache-hit ratio tell you?

The cache hit ratio is the ratio of the number of times a memory location is referenced and is successfully found to be in the cache (a cache hit) to the total number of memory refences.

True or false: Round robin scheduling degrades to FIFO if the timeslice becomes too long.

True

True or false: The only resource given up by a blocked process is the CPU.

True

True or false: The use of unequal-sized fixed partitions fails to resolve the fragmentation problem.

True

True or false: Using virtual memory allows us to put only part of a program into memory at a time.

True

True or false: Virtual memory systems should not be used for real-time applications.

True

What is / are the main differences between Kernel Level Threads and User Level Threads?

ULTs allow the user more control LKTs are slower

Computer memory that loses its contents when electrical power is lost is said to be ___________.

Volatile

Computer memory that loses its contents when electrical power is lost, is said to be __________ .

Volatile Memory

The set of pages of a process present in real memory is the _______ set.

resident

A ____ is the first thing that happens when an error occurs while trying to get or execute an instruction

trap

In providing a mutual exclusion mechanism, we cannot assume that fast running processes do not cause problems.

true

It is unsafe and/or undesirable to let a *nix (unix, linux, etcc) process catch to handle all possible signals sent to it.

true

Having detected deadlock, briefly describe two strategies that can be used to correct the problem

two from: * delete all deadlocked processes *delete deadlocked processes one by one until deadlock is gone *roll deadlocked processes back to a previous checkpoint and allow them to move forward again from that point

Traps and interrupts are very similar; name one thing that makes interrupts different from traps in the way they are handled.

• Interrupts have priorities, traps do not • Traps are processed immediately when they occur, interrupts are deferred until the current instruction finishes • An interrupted process often resumes, but it is rare for a process that experienced a trap to resume

Match the memory type with its best description. 1. Requires constant refreshing 2. Retains data as long as power is supplied 3. Provides a que for the CPU resulting in significant speed increases.

1. DRAM 2. SRAM 3. Cache

We have seen that there are two main operations performed ith semaphores wait(s) and signal(s). When a program uses a semaphore to control access to a section of code, which of wait(s) or signal(s) does it perform to determine if it can enter a critical section. Does it matter? Why / why not.

1. use wait(s) to determine if a process can enter the code 2. yes, it matters. Signal(s) will not work. A wait() can block a process A signal() can unblock a process The wait() functions allow a thread to block its own execution

In a 32-bit OS, suppose page a is 2KB (2048 bytes). What is the offset to the last work on page a?

2044

98 KB will fit into 4-KB pages, with ______ wasted space.

24 pages, 2 KB waste

A process with 10 threads in it runs on a system where the kernel handles all thread management; how many of the threads can continue to run if one of them blocks?

9

Suppose a system used 512-byte pages; how many address bits are needed to offset onto a page (hint 1024 = 210)

9

Approximately how many bytes are actually available on a "100 GB" hard drive?

93 GB

Name two things that using virtual memory on a computer lets you do that you can't do if it does not use virtual memory?

Allows processes that may be larger than all of the main memory Runs programs faster because it is not reading from storage

User area consists of i) stack area, ii) data area, and iii) text area? What do the data area and text area mean?

Data area is for global variables; text are is for instructions.

Assume we are dealing with a system tat places processes in memory following a dynamic partitioning scheme. At some point in time we have just loaded a process that needs 42 KB of memory. Memory space is as depicted below. Shaded regions are full, blanks are holes (with sized in KB as indicated). The darkly shaded region (black) is the process most recently loaded. Indicate where a new process requiring 42kb of memory will be positioned if the placement policy is: 1. best fit 2. first fit 3. worst fit 4. next fit

Best fit 46 First fit 48 Worst fit 50 Next fit 48

Two kinds of semaphors: counting and _______.

Binary

During the time a process is "in in the system" it may become blocked at some point. Briefly explain the value of blocking a process as opposed o letting it "continue" as is. What causes a blocked process to become unblocked. What difference to the process, and to the OS, does it make if the process is "blocked" or "blocked and swapped"?

Blocking a process frees up the CPU to work on other processes, so we can be more efficient and gain better performance. Not blocking a process that is waiting for an event to happen wastes CPU time the process cannot proceed. When the eve that the process is waiting for occurs, the process is unblocked. A blocked process stays in memory but does not consume CPU resources. A blocked and swapped process is moved out of memory. This will take longer to resume since it has to be swapped back into memory again when unblocked. Thus more memory is available if the process is swapped out.

Part of computer that mediates movement of data between CPU and other system components like memory or peripherals:

Bus

The __________ executes instructions retrieved from memory.

CPU

An area of code that must not be simultaneously accessed by more than one process is a ___________.

Critical Section

An area in a program that must not be accessed by more than one process at a time is a __________.

Critical section

The fastest I/O devices use ______ for direct transfer of data between memory and themselves.

DMA (direct memory access)

Match the memory type with its best description. Requires constant refreshing Retains data as long as power is supplied Provides a queue for the CPU resulting in signficant speed increases

DRAM SRAM Cache

Unix/Linux provides a signal mechanism as a way for one process to get another's attention. Suppose processes A wants to send a signal to process B. Can process B itself catch all signals sent to it? Briefly explain why or why not.

No it cannot. No process can catch signal 9; in this way UNIX guarantees it has the ability to stop any process (otherwise, the OS could not have an assurance of stopping processes).

You have been tasked with implementing a system to operate an oil refinery - a system with thousands of time sensitive inputs to e monitored and acted upon. You are being pressured by management to adopt Windows 10 as the OS to be used throughout. Based solely on your understanding of virtual memory, which Windows 10 uses, is it safe to choose it as the OS for this system? Why or why not.

No. Time sensitive or real-time systems should not use virtual memory due t potential delays during page faults.

The only tool that comes standard with Windows for pure plain-text editing.

Notepad

A hardware instruction to support mutual exclusion:

One of: ts,exch

Which of the following are considered to be non-volatile memory? (Select all that apply)

Optical drives, Magnetic Tape, USB drives

What you get when you cannot find a page table entry for a page:

Page Fault

What do you get by adding a virtual address to a base register in a paged memory system?

Physical address / real address / physical memory address

Which part of a computer is responsible for operating / coordinating all of it's components.

The Operating System

Mutual exclusion (Mutex) cannot be implemented with hardware (CPU) support. Describe why?

The lock operation involves two tasks: test and set. They should be done without being interrupted. CPU should support the special test&set instruction.

True or false: Processes that can no longer make use of the CPU become blocked until they can again make use of the CPU.

True

You note that a computer system is not using its CPU very much, so you arrange to run more processes on it, hoping to keep the CPU busier. As you increase the number of processes on this system you observe that performance becomes drastically worse after a certain point: all processes start taking much longer to run. Up to this point, you discovered that the CPU was, at most, busy 30% of the time running your processes. After this point, that numbers becomes 0.2%. What do you suspect the problem to be? A manager suggests that you should get a faster CPU for the computer: would this help? Briefly explain why or why not.

The problem is that the system has begun thrashing: spending more time resolving page faults than advancing processes toward completion. A faster CPU will accomplish nothing: the current, presumably slower, CPU was not fully occupied. The problem is related to available of real memory, not lack of CPU speed.

Handling a page fault requires that the missing page be located on disk and loaded into memory. The wait for this operation is overwhelmingly dominated by the time the disk takes to respond. Briefly describe a situation in which the waiting time (time from when page fault occurs to when the page is available in memory for use) maybe twice as long as what is described here.

The waiting time for resolution of a page fault is primarily the time it takes to get the page from the disk (rotation and seek delays drive this delay). The delay may be twice as long if no memory frames were available to hold the newly sought page *and* no page in any frame is unmodified, meaning that a page must first be written out to disk before a frame is available to hold the new page. Recall that writing to disks is slower than reading (but still overwhelmingly dominated by rotational and seek delays.)

Race conditions can affect the way processes behave in undesirable and unpredictable ways. Name four conditions that must be satisfied for race conditions to be possible on a system: 1. 2. 3. 4.

This question was deleted

The point where most of the CPU time is spent waiting for and handling page faults is generally referred to as ____.

Thrashing

Semaphores are a software mechanism designed to provide mutual exclusion. Name and briefly describe the three operations that can be performed on a semaphore.

Three operations on semaphores: 1. initialize: initialize the semaphore counter to some integer value 2. wait: decrement the semaphore counter by one: if it is now <0, suspend the process and place it in this semaphores queue. 3. signal: increment the semaphore counter by one: if it is now <=0, select some process from the semaphore's queue to be resumed.

Special associative cache memory used to speed up page table lookups:

Translate Lookaside Buffer(TLB)

Address bus can be larger than data bus in many cases

True

Bus consists of control, address and data bus.

True

Deadlines are used by processes to tell the kernel the times by which they must have started and/or stopped running.

True

External fragmentation results from memory partitions that are too small to be useful.

True

True of false: Most practical OS simply ignore the possibility of a deadlock

True

True or false: Cache coherency on multi-processor systems sharing a single memory is much harder to maintain than on a uni-processor

True

True or false: Every UNIX/linux process (except one) is a child of some parent process.

True

True or false: Generally, the fast the memory, the more expensive it is.

True

Your boss is discussing error handling in an OS. He says that memory-related traps are considered more serious so are always handled ahead of (ie have priority over) lesser traps like arithmetic traps. Is he right? Why or why not.

all traps have the same priority

This guided medium carries signals farthest and is immune to electromagnetic interferences.

fiber

Arrange in order from longest latency to shortest(i.e. slowest access time to fastest), making sure to indicate which is fastest: optical disk, register, RAM/main memory, magnetic disk, cache

from slowest(longest latency) to fastest(shortest latency): optical disk, magnetic disk, RAM/main memory, cache, register

A "page reference string" as we saw in class, is a list of the pages of a process that are referenced in sequence as addresses in the program are referenced. For the page reference string: 1 5 1 4 3 2 6 1 Show how the behavior of the paging mechanism with 3 frames and indicate where page faults result from use of FIFO page replacement Total page faults (counting initial loads): _________

reference string: 1 5 1 4 3 2 6 1 frame 0: 1 1 1 1 3 3 3 1 fame 1: - 5 5 5 5 2 2 2 frame 2:- - - 4 4 4 6 6 page fault? + + + + + + +


संबंधित स्टडी सेट्स

CompTIA Network+ Certification Exam N10-007 Practice Test 5

View Set

PMP Exam Prep - Communications Management

View Set

AP Biology AP Classroom Unit 7 FRQ

View Set