CS 450 Final WVU

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

What are I/O bound and CPU bound processes, and why is it important to maintain a good process mix?

A CPU bound process is characterized by long bursts of CPU usage interspersed w/ durations of I/o interspersed w/ short periods of execution. If the system is dominated by one type or the other, we might see a training effect where processes queue up waiting for either CPU or I/O devices while the other is underutilized. A balance of each type ensures that both the CPU and other resources are evenly utilized.

The difference between a child process and a thread is that:

A child process is a full independent primary process with its own execution state and capable of running a different program than the parent process. Scheduled independently from the parent. while, a thread is a sequence of execution within a parent process, executing code from within the parent process and other threads of that process

What is a context switch?

A context switch occurs when the state of the currently executing process is saved and the context of a different process is restored, allowing the other process to resume execution.

In the ______________ state a process is waiting for a resource or event other than the CPU

Blocked

What is the context of a process?

The contents of the CPU registers which represents current execution state of a process

1. Explain why SSTF scheduling tends to favor middle cylinders over the innermost and outmost cylinders?

The cylinders at the outermost and innermost positions are the full width of the disk apart. They are also the furthest distance from the cylinder at the middle of the disk. SSTF always picks to next operation so that the head travels the fewest number of tracks possible. IF the head is at either extreme and 2 pending operations exist, one in the middle of the disk and the other at the other extreme, the middle operation will always be chosen first. Once in the middle we will tend to say in the middle servicing future operations. So it favors the center tracks.

W/ respect to resource mgmt, one goal of the operating system is to support controlled sharing, what does this mean.

This goal ensured that any process needing a resource will eventually gain control of that resource in a way that is "fair" based on the processes characteristics.

One measure of the effectiveness of a cpu scheduling algorithm is to track the system throughput. WHat is this?

This is the measure of the amt of work performed (# of jobs completed) per time period

In some scheduling algorithms, this limits the amt of time a process can execute continuously without voluntarily giving up the CPU

CPU Time Quantum

Non-Preemptive Priority

Choose the highest priority process, if two have the same priority FIFO

How does polling work?

READ - The host continually checks the status register to see if the device has transmitted data. Then it accesses the data, determines if the operation is complete, waits for the next character if needed. WRITE - places character in data register, sets the control register, then checks the status register to see if character has been moved. The whole idea is that the driver must monitor each step of the transfer by repeatedly checking the status register, then performing the next part of the operation, until it is complete.

What is different about the scheduling of real time processes?

Real time processes have a release time, or a time by which it must be selected for execution once it enters the system. Real time processes have a deadline which is the time by which a process must finish execution for its results to be meaningful.

What is the difference between internal and external fragmentation

internal fragmentation is when a process does not use all of the block of memory allocated to it, but holds it so that it can not be allocated to another process External fragmentation is when the blocks of free memory become scattered throughout physical memory such that it can not be allocated to fulfill allocation requests.

This structure, in low memory, stored the addresses of special routines which are automatically invoked whenever an interrupt occurs _____________

interrupt vector table

When an operating system is executing operating system code to perform system calls, or system related tasks it is executing in _____________

kernel mode

This scheduling algorithm maintains multiple ready queues, each w/ a different priority, processes can be demoted to a lower priority queue if it consumes multiple consectutive time quanta or promoted to a higher priority the longer it takes to execute

multi level feedback queues

The scheduling algorithm assigns priorities to real-time processes based on the length of their periods (time b/t releases) the longer the period the lower the priority:

rate monotonic

Set of processes waiting for a chance to use the processor and execute are stored in the _____________

ready queue

This scheduling algorithm usually produces the longest avg wait time for a set of processes b/c the waiting time of any process is (N-1)*Q in each cycle _______________

round robin

With respect to contiguous AND non-contiguous allocation strategies, do they suffer from internal and/or external fragmentation.

· Contiguous -- Yes it suffers from both, o Internal: Since we are allocating a single block of memory a process may not use all of the memory allocated to it, particularly in some strategies such as fixed partitions, a process might be allocated more space than it will use o External—A primary problem with this strategy, because as blocks of memory are allocated and freed, the free blocks become scattered throughout physical memory · Non-contiguous- o Internal is less of an issue, since we are allocating smaller individual blocks based on the structure of the process § Paging minimizes internal fragmentation by the small size of each page. The last page of a process will generally have some unused space unless a process is an exact multiple of the page size, but it is relatively small § Segmentation is based of the structure and layout of the program and other segments of the process itself, Some internal fragmentation might occur for the stack and or heap of a process. o External: § With paging since all blocks are the same size, this virtually eliminates external fragmentation. § With segmentation it is still a problem since segments are all of differing sizes, when loading a process we need to find N blocks of random sizes and it is similar to contiguous memory allocation

What is a process? Explain 3 possible states that a process might be in.

A process is a program in execution under the control of the operating system. · Ready: Holds all needed resources and is waiting for a chance to execute · Running: the process is currently executing · Blocked or Waiting: The process is waiting for a resources or the completion of a system call · Initial: The process is being created, and allocated initial resources before joining the ready queue. · Terminal: The process is terminated normally and abnormally and in this state the system frees any resources held by the process, reassigns any child processes, and deallocates the PCB · Suspended blocked: This occurs when a process is blocked, but is temporarily swapped to disk. This might occur if the process's memory time quantum expires · Suspended ready: The event a process has been waiting for has occurred, and it is waiting to be swapped back into memory.

Why is a static priority based cpu scheduling algorithm not practical?

All of these algorithms choose processes to execute based on either their expected execution time or a fixed numerical priority. As long as higher priority processes enter the system, lower priority processes starve

___________ is when multiple processes seemingly execute at the same time all making progress, when really they are interleaving.

Concurrency

A multiprogramming operating system:

Has multiple processes in memory at the same time, and executes them in an interleaved fashion such that when one voluntarily waits or completes, another executes. Goal is increased throughput and resource usage.

A multitasking operating system:

Has multiple processes in memory simultaneously taking turns to use the cpu, the processes interleave based on a strict time limit. The goal is consistent response time to support multiple interactive users.

1In a multiprogramming OS what might be the issue if the following situations occur, and what should it do: a. The scheduler determines that CPU utilization is low

If the CPU utilization is low, this means that processes are spending more time performing I/O operations with shorter CPU bursts. This could indicate that there is a predominance of I/O bound processes in the system.

1In a multiprogramming OS what might be the issue if the following situations occur, and what should it do: a. The scheduler determines that I/O device utilization is low

If the utilization of I/O devices is low, then this would indicate that there is a predominance of CPU bound processes in the system, characterized by long CPU bursts followed by short or no I/O operations

WHat is the difference between asymmetric and symmetric multi-processing?

In an asymmetric multiprocessing system one processor acts as a master processor assigning tasks to the other processors. In a symmetric multi processing system, each processor is self scheduling and can perform all system related tasks.

A ______________ signals that some type of event has occured within the computer system which requires immediate service by the OS. May be caused by either hardware or software.

Interrupt.

Why was the introduction of interrupts important?

It allows the OS to be event driven, to dynamically respond to events that happen within the computer system such as software traps, requests from I/O devices, and periodic events such as clock ticks.

1. In the R1, instructions, we tell you to use the following test to see if a character is available. EXPLAIN in DETAIL what this instruction is doing!!!! if inb(COM1+5)&1

It isolates a single bit (low order bit) in the status register, if it is "1" then the device has produced a character!!!

Suppose that a scheduling algorithm (at the level of short-term CPU scheduling) favors those processes that have used the least processor time in the recent past. Why will this algorithm favor I/O-bound programs and yet not permanently starve CPU-bound programs?

It will favor the I/O-bound programs because of the relatively short CPU bursts requested by them; however, the CPU-bound programs will not starve, because the I/O-bound programs will relinquish the CPU relatively often to do their I/O. Additionally, the longer a process waits, it is not consuming cpu time which (like in the unix algorithm) will eventually let it have a chance to execute.

What is a device driver?

Its a software module, which contains the device specific code to communicate with a specific type of I/O device. It translates generic commands issued by the OS into device specific commands and sends them to the controller for that device.

WHy is load balancing important for symmetric multiprocessing systems?

Load balancing attempts to keep the work distributed across all processors so that no processors are idle while others have many processes to run

A batch serial operating system:

Loads and executes one process after another from the job pool, in the order submitted to the system. One process has complete control of the system. Attempts to reduce cpu idle time via the resident monitor, which does automatic job to job transitions.

Explain the difference between the long term scheduler and the short term scheduler. Which one needs to be more efficient and why?

Long term (job) scheduling determines when a job is admitted into the system as a process. Short term (CPU) scheduler selects from among the processes in the ready queue and allocates the CPU to one of them. The short term scheduler must be more efficient because of the frequency in which it runs.

A multiprocessing operating system:

Manages and schedules multiple processors (CPUs) to execute user processes by interleaving them.

What is the significance of the concepts of multiprogramming and how is multi-tasking, similar yet different?

Multiprogramming was introduced to increase throughput, by allowing the interleaving of processes such that when one waits for a resource or the servicing of a system call, another process can execute. This greatly reduced CPU idle time over batch serial operating systems in which a single process has control of the entire system. Multi-tasking IS multiprogramming it is also sometimes called TIME SHARING, but the switching between processes is fast enough to support interactive processes. Processes are switched using a CPU time quantum or time slice. This minimizes RESPONSE time!! (Time sharing switching based on time ) Modern operating systems are multi-tasking

_____________ describes a process storing info about the process's name, state, assigned resources and context.

PCB (Process control block)

____________ implies a system can perform more than one task simultaneously by executing multiple processes across multiple processors.

Parellellism

A CPU scheduling algorithm which employs __________ will interrupt the currently executing process if a higher priority process becomes available.

Preemption

Shortest Job Next

Select the next job based on the expected execution time

______________ is when a waiting process never gets control of a needed resource such as the CPU, because higher priority processes are always available.

Starvation

Explain the difference between dynamic .vs. static relocation? Why is dynamic relocation needed?

Static relocation happens before or when the process is first loaded into memory meaning the process can not be moved once execution has begun. Static relocation can occur during compilation, when the compiler produces "absolute code" meaning executable contains physical addresses and the program must always be loaded into the same location in memory. Static relocation can occur with the process is first loaded, using a "relocation dictionary" which is created by the compiler. The object file contains addresses in the form of displacements, once the location of the process is known, the relocation dictionary tells how addresses need to be adjusted. Once the process is loaded, it can not be moved again dynamic relocation happens during execution. The process generates virtual addresses in the form of displacements from the beginning of the module. The base address (or starting address) of the process is stored in a special register called the relocation register, whose contents are always added to the virtual addresses to create the correct physical address. To move a process we simply change the contents of the relocation register.

1. In your own words, what is the purpose of the polling function in R1.

The polling function is used to collect characters produced by the serial port, storing them in a buffer, until an entire command is produced, signified by the input of the "enter" or "return character. It simply gathers characters it does not interpret the meaning of the command!!!

What is interrupt latency?

The time between when an interrupt is recognized by the CPU and the correct interrupt handler is dispatched.

Dynamic priority scheduling algorithms:

Use the technique of aging to periodically modify the priority of process which has not had an opportunity to execute during a specific time period

This is a special type of light weight process (execution sequence) which provides concurrency within a process by executing part of the parent process's code and sharing resources and state with the parent process:

User thread

Once a process has been selected for execution, the _____________ is responsible for restoring the context of the process, switching to user mode, and then starting execution based on contents of the IP

dispatcher

Explain the difference between a contiguous allocation strategy vs a non-contiguous allocation strategy (such as segmentation).

With a contiguous allocation strategy, a process is allocated a single block of memory which must contain all of the parts of the process's logical address space. With a non-contiguous strategy the process's logical address space is broken into a series of blocks. The individual blocks can be loaded into memory so that individual blocks can be scattered through out memory where every space is available, and address translation is provided through the use of a translation table.

What is contiguous memory allocation?

With contiguous memory allocation, a process must be contained in a single block of memory.


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

Psychology 201 Exam 1 Practice (LEARNING CURVE 2a and 2b)

View Set

Module 9 - Obsessive and Compulsive Related Disorders

View Set

Drugs & Behavior - Test 4 - Chapter 7 & 8

View Set

Quiz: Put on Sterile Gloves and Remove Soiled Glove

View Set

Week 2: Stakeholders & Workers' Co-Operative

View Set

Entrepreneurship II Final Exam Review

View Set

GDP, unemployment, and inflation test review

View Set