Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

COP4600 Final Exam 2025-2026 Definition of Terms (100% Correct), Exams of Computer Science

What are advantages of providing process cooperation? - ANSWER - Information sharing Computation Speedup Modularity Convenience What are advantages and disadvantages of the synchronous communication? - ANSWER - Advantages - Sender and receiver can rendezvous, which makes the producer-consumer problem trivial. Disadvantages - Additional rendezvous points may be generated even though they are not required. This creates additional delays and overhead for no real reason. What are advantages and disadvantages of the asynchronous communication? - ANSWER - Advantages - Processes can send requests and continue working in the background without having to wait on the consumer. Disadvantages - Some processes must occur sequentially (synchronously) to work correctly. What are advantages and disadvantages of the fixed-sized messages? - ANSWER - Advantages - Easier to implement Disadvantages - Makes programming more difficult

Typology: Exams

2024/2025

Available from 05/25/2025

maina-wachira-1
maina-wachira-1 🇺🇸

674 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COP4600 Final Exam 2025-2026
Definition of Terms (100% Correct)
What are advantages of providing process cooperation? - ANSWER - Information
sharing
Computation Speedup
Modularity
Convenience
What are advantages and disadvantages of the synchronous communication? -
ANSWER - Advantages - Sender and receiver can rendezvous, which makes the
producer-consumer problem trivial.
Disadvantages - Additional rendezvous points may be generated even though they are
not required. This creates additional delays and overhead for no real reason.
What are advantages and disadvantages of the asynchronous communication? -
ANSWER - Advantages - Processes can send requests and continue working in the
background without having to wait on the consumer.
Disadvantages - Some processes must occur sequentially (synchronously) to work
correctly.
What are advantages and disadvantages of the fixed-sized messages? - ANSWER -
Advantages - Easier to implement
Disadvantages - Makes programming more difficult
What are advantages and disadvantages of the variable-sized messages? - ANSWER -
Advantages - Easier to program against
Disadvantages - More complex implementation required
Describe the action taken by kernel to context-switch between processes. - ANSWER -
1. Kernel saves the context of the old process in its PCB
2. Loads the saved context of the new process scheduled to run
States of Programs in Execution - ANSWER - New
Running
Waiting
Ready
Terminated
Context Switching definition - ANSWER - When CPU switches to another process, the
system must save the state of the old process and load that saved state for the new
process
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download COP4600 Final Exam 2025-2026 Definition of Terms (100% Correct) and more Exams Computer Science in PDF only on Docsity!

COP4600 Final Exam 2025-

Definition of Terms (100% Correct)

What are advantages of providing process cooperation? - ANSWER - Information sharing Computation Speedup Modularity Convenience What are advantages and disadvantages of the synchronous communication? - ANSWER - Advantages - Sender and receiver can rendezvous, which makes the producer-consumer problem trivial. Disadvantages - Additional rendezvous points may be generated even though they are not required. This creates additional delays and overhead for no real reason. What are advantages and disadvantages of the asynchronous communication? - ANSWER - Advantages - Processes can send requests and continue working in the background without having to wait on the consumer. Disadvantages - Some processes must occur sequentially (synchronously) to work correctly. What are advantages and disadvantages of the fixed-sized messages? - ANSWER - Advantages - Easier to implement Disadvantages - Makes programming more difficult What are advantages and disadvantages of the variable-sized messages? - ANSWER - Advantages - Easier to program against Disadvantages - More complex implementation required Describe the action taken by kernel to context-switch between processes. - ANSWER -

  1. Kernel saves the context of the old process in its PCB
  2. Loads the saved context of the new process scheduled to run States of Programs in Execution - ANSWER - New Running Waiting Ready Terminated Context Switching definition - ANSWER - When CPU switches to another process, the system must save the state of the old process and load that saved state for the new process

Context Switching Info - ANSWER - All time is overhead; no useful work done while context switching More complex the OS and PCB -> longer it takes to context switch Time dependent on hardware support Kernels - ANSWER - Generally multithreaded What are the user and system goals in operating system design? - ANSWER - User: Easy to learn and use System: Error-free, efficient What are the two main categories of the services and functions provided by an operating system? Briefly describe them. - ANSWER - User - Functions helpful to the user Resource Allocation - Resources be allocated to users/jobs

  • Accounting - Keep track of which users use resources
  • Protection - Involves ensuring all access is controlled
  • Security - User auth, defends I/O from invalid attempts What are the five major activities of an operating system with regard to process management? - ANSWER - End, abort Load, execute Create process, terminate process Get and set process attributes Allocate and free memory What are the six major categories of system calls? - ANSWER - Process Control File Management Device Management Information Maintenance Communications Protection What are the three different forms of a user operating system interface that almost all operating systems have? - ANSWER - Command Line Interpreter Graphical User Interface Batch Command What is the fundamental idea behind a virtual machine? - ANSWER - Allocating resources to separate system entities. What are two models of inter-process communication? Briefly describe each of them. - ANSWER - Shared Memory - Communicating processes establish a region of shared memory

rate monotonic scheduling - ANSWER - A scheduling algorithm where a priority is assigned based on the inverse of its period. Shorter periods = higher priority. Longer periods = lower priority. resource allocation graph - ANSWER - This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes: P = {P1, P2, ..., Pn}, the set consisting of all the active processes in the system, and R = {R1, R2, ..., Rm RPC - ANSWER - Abstracts procedure calls between processes on networked systems safe state - ANSWER - System is in this if there exists a sequence <P1, P2, ..., Pn> of ALL the processes in the system such that for each Pi, the resources that Pi can still request can be satisfied by currently available resources + resources held by all the Pj, with j < i security - ANSWER - Defense of the system against internal and external attacks segmentation - ANSWER - Supports this view by providing addresses with a segment number ( mapped to a segment base address ) and an offset from the beginning of that segment. sequential access - ANSWER - Uses a small master index that points to disk blocks of a secondary index. The secondary index blocks point to the actual file blocks. The file is kept sorted on a defined key. To find a particular item, we first make a binary search of the master index, which provides the block number of the secondary index. This block is read in, and again a binary search is used to find the block containing the desired record. Finally, this block is searched sequentially. In this way, any record can be located from its key by at most two direct-access reads short term scheduler - ANSWER - Selects which process should be executed next and allocates CPU. Sometimes the only scheduler in a system. Is invoked frequently (milliseconds) (must be fast) socket - ANSWER - An endpoint for communication. A pair of processes communicating over a network employ a pair of sockets — one for each process. Identified by an IP address concatenated with a port number. In general, it uses a client - server architecture. starvation - ANSWER - Indefinite blocking. A process may never be removed from the semaphore queue in which it is suspended static linking - ANSWER - Library modules get fully included in executable modules. Wastes both disk space and main memory usage. Every program that included a

certain routine from the library would have to have their own copy of that routine linked into their executable code. dynamic linking - ANSWER - Only a stub is linked into the executable module, containing references to the actual library module linked in at run time. swapping - ANSWER - A process can be swapped temporarily out of memory to a backing store and then brought back into memory for continued execution symmetric clustering - ANSWER - Has multiple nodes running applications, monitoring each other symmetric multiprocessing - ANSWER - Each processor performs all tasks system call - ANSWER - Programming interface to the services provided by the OS thrashing - ANSWER - a process is busy swapping pages in and out throughput - ANSWER - # of processes that complete their execution per time unit time sharing - ANSWER - Logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing TLB - ANSWER - Associative, high-speed memory. Each entry in it consists of two parts: a key (or tag) and a value. When the associative memory is presented with an item, the item is compared with all keys simultaneously. If the item is found, the corresponding value field is returned. The search is fast; the hardware, however, is expensive. turnaround time - ANSWER - Amount of time to execute a particular process user mode - ANSWER - When the computer system is executing on behalf of a user application valid bit - ANSWER - When it is set to this, the associated page is in the process's logical address space and is thus a legal invalid bit - ANSWER - When is is set to this, the page is not in the process's logical address space. virtual memory - ANSWER - A technique that allows the execution of processes that are not completely in memory. One major advantage of this scheme is that programs can be larger than physical memory.

Internal Fragmentation - ANSWER - Is the wasted free space located within the address space of a process. External Fragmentation - ANSWER - Is the wasted free space not allocated for anything in the physical memory. MMU - ANSWER - Memory Management Unit - translates a page address to a frame address. TLB - ANSWER - Translation Lookaside Buffer - a table located in the registers that keeps a cache of the page table. Frame - ANSWER - In paging, physical memory is divided into a number of equal sized blocks. Each of these is referred to as a _________. Hit Ratio - ANSWER - The percentage of time that the desired information is found in the TLB Hot Stand By Mode - ANSWER - A computer that is monitoring other computers that are actively executing applications. If the executing machine fails, the hot standby host will take over. Independent Process - ANSWER - A process that cannot affect or be affected by the execution of another process. Interprocess Communication - ANSWER - How Cooperating processes communicate with each other. The two models are Shared Memory and Message Passsing. Interrupt - ANSWER - Triggered by CPU Signal or System Call. Can be Asynchronous or Synchronous. Kernel Mode - ANSWER - Where higher security instructions are executed. Layered Approach - ANSWER - OS Design in which the operating system is divided into a number of levels, each built on top of lower levels. Logical Address Space - ANSWER - Set of all CPU-generated addresses which have been generated by a program. Long Term Scheduler - ANSWER - Responsible for determining which processes should be brought into the ready queue. Memory Sharing - ANSWER - A model of Interprocess Communication in which cooperating processes have a common space in memory.

Message Passing - ANSWER - A model of Interprocess Communication in which cooperating processes establish a communication link using system calls. Microkernel - ANSWER - OS Structure in which core kernel only has the essentials, however communication occurs with other modules through message passing. MMU - ANSWER - responsible for mapping logical addresses to physical addresses Multi-level Feedback Queue - ANSWER - Developed to address the problem of processes suffering from scheduling deficiencies in a multilevel queue. Multi-level Queue - ANSWER - A scheduling system in which processes are categorized and placed on separate queues based on common characteristic. Multiprogramming - ANSWER - Ensures efficiency of a system by making sure a single user cannot keep the CPU and I/O waiting indefinitely. Multitasking - ANSWER - (aka timesharing) is the ability of a CPU to switch jobs so frequently that users can interact with each job while it is running, creating interactive computing. Mutual Exclusion - ANSWER - Prevention of simultaneous access to a shared resource Non-blocking Message Passing - ANSWER - Asynchronous message Passing. Page Fault - ANSWER - When a page is referenced but not yet in memory. Page Table - ANSWER - Used to look up what frame a particular page is stored in at the moment Paging - ANSWER - A Memory Management method in which physical memory is divided into a number of equally sized blocks. Parallelism - ANSWER - Distribution of threads or data across multiple processors Peer-to-Peer Network - ANSWER - Network in which nodes can act as either client, server, or both. Peterson's algorithm - ANSWER - Software based solution for solving the critical section problem in which the processes should share the two variables of "int turn;" and "Boolean flag[2]". Pipe - ANSWER - Acts as a conduit allowing two processes to communicate. Page Replacement Algorithms - ANSWER - FIFO, Optimal, LRU, Second Chance

The addresses that the CPU uses in normal operations. - ANSWER - Logical or Virtual Addresses The addresses that are actually accessed in memory. - ANSWER - Physical Addresses Mapping between address types is done by the __________ __________ __________.

  • ANSWER - Memory Management Unit With ________ __________, when a program is loaded, only its main routine is loaded and started; additional routines are loaded as they are called. - ANSWER - Dynamic Loading With __________ __________, or __________ __________, rather than including all referenced routines from a library in the executable file, the linker includes stubs for those routines. - ANSWER - Dynamic Linking or Shared Libraries Moving processes between memory and a backing store is called __________. - ANSWER - Swapping In __________ __________ allocation we divide memory into multiple partitions (that can even be of a different size), allocating exactly one per process. - ANSWER - Fixed- Partition In __________ __________ allocation the system has to keep a table indicating which parts of memory are occupied. - ANSWER - Variable-Partition Physical memory can be broken into fixed-size blocks called __________. - ANSWER - Frames Logical memory can be broken into blocks of the same size called __________. - ANSWER - Pages __________ completely eliminates the external fragmentation and memory hole problem. However it does induce internal fragmentation. - ANSWER - Paging In __________, when a process is to be executed, its pages are loaded into frames. - ANSWER - Paging Is a cache for page table entries. - ANSWER - Translation Look-Aside Buffer Loads only pages that are actually going to be used into physical memory. - ANSWER - Demand Paging Generated whenever an invalid page is accessed. - ANSWER - Page Fault

This causes a very high proportion of all memory access to result in page faults. - ANSWER - Thrashing Figures out how to select victim pages that will not be needed again soon. - ANSWER - Page Replacement Algorithm Keeps the system running by swapping out a process. This decides which process to swap out. - ANSWER - Thrashing Prevention Algorithm __________ is like ordinary relocation except it allows each process to have multiple segments. - ANSWER - Segmentation Segments use __________ tuples as their addresses. - ANSWER - Explicit Pages use __________ tuples as their addresses. - ANSWER - Implicit With some page replacement algorithms, the number of page faults can increase when the number of available frames rises. These algorithms are said to suffer from __________ __________. - ANSWER - Belady's Anomaly Algorithms are called __________ ___________ if the set of pages with fewer frames available is always a strict subset of the set of pages with more frames available. - ANSWER - Stack Algorithms __________ __________ cannot suffer from Belady's anomaly. - ANSWER - Stack Algorithms The _________ algorithm can be proven to be the best possible page replacement algorithm. However, it cannot actually be implemented in the general case. - ANSWER - Optimal __________ page replacement is when we replace the page that hasn't been used for the longest. - ANSWER - LRU An LRU implementation, it associates a CPU clock time with each page table entry. - ANSWER - Counter Implementation An LRU implementation, maintains a list of all referenced pages in a double linked list. - ANSWER - Stack Implementation An LRU approximation, each page in the table is given a reference bit. The bit is set to 1 whenever the page is referenced. - ANSWER - Second Chance An LRU Approximation, each page has a reference bit. The reference bit is treated as the top bit of a reference integer. - ANSWER - Additional Reference Bits

Not Recently Used Page Replacement - ANSWER - Keeps track of two bits; References and Modified. When a process first begins everything is a page fault. MMU adds them to page table. As time progresses pages will be read and modified. System will automatically clear referenced bits to prevent stagnation. Four different classes with lowest priority classes being wiped. FIFO Page Replacement - ANSWER - OS maintains a list of all pages currently in memory. Oldest pages are at the head, and newest pages are at the tail. Replacement happens at the head. Performs poorly Clock Replacement Algorithm - ANSWER - More efficient version of FIFO than second chance because pages are not pushed to the back of the list. Same function as second chance. Second Chance Page Replacement - ANSWER - OS maintains a list of all pages currently in memory. Oldest pages are at the head, and newest pages are at the tail. If the RF bit is not set we will be removing it from the list. Least Recently Used Page Replacement - ANSWER - Working Set Page Replacement - ANSWER - Loads into memory only when a page fault occurs. This method is slow because the entire page table must be read. Thrashing - ANSWER - Occurs when a process doesn't have enough frames to adequately store the pages. This means that the OS will constantly be asking for more pages. Dual mode - ANSWER - - Allows OS to protect itself and other system components

  • User mode and kernel mode - determined by mode bit
  • Kernel mode can run privileged commands
  • System call changes mode to kernel (0), retrun from call resets it to user (1)
  • API calls call external libraries Process States - ANSWER - New Running (waiting to be assigned) Waiting (Waiting for I/O event) Ready Terminated Interrupt - go from running to ready

Scheduler Dispatch - go from ready to running Process Control Block - ANSWER - Managed in OS memory Process state, proces number, program counter, registers, memory limtis, list of open files Schedulers - ANSWER - Long-Term Scheduler Medium-Term Scheduler Short-Term Scheduler Long Term Scheduler - ANSWER - Selects processes from queue to load into memory for execution Medium Term Scheduler - ANSWER - Swap out processes that are waiting in memory Short Term Scheduler - ANSWER - Decides which process in memory to execute after clock tick Creating a new process - ANSWER - fork() Generates a child process Successful child process has pid == 0 Parent has pid > 0 Interprocess Communication (IPC) - ANSWER - Mechanism for processes to communicate and sync their actions T/F Threads have their own data, blocks, etc - ANSWER - True CPU Scheduler - ANSWER - Selects from among processes in ready queue and alloactes one to CPU First come, first serve scheduling Priority Scheduling - ANSWER - Each process assigned a priority Same priority is first come first serve Round Robin Scheduling - ANSWER - Each process is assigned a fixed time slot Starvation free but high overhead Multilevel Feedback Queue - ANSWER - Give preference to short jobs Give preference to I/O

x.signal() resumes process that invoked x.wait() Solaris Synchronization - ANSWER - -Implements a variety of locks to support multitasking, multithreading (including real-time threads), and multiprocessing Uses adaptive mutexes for efficiency when protecting data from short code segments Uses readers-writers locks when longer code sections need access Deadlock Requirements - ANSWER - Each member of group is waiting for another Can arise if four conditions meet

  1. mutual exclusion
  2. hold and wait
  3. no preemption
  4. circular wait Mutual Exclusion - ANSWER - One process can use a resource. If multiple processes can use a resource, then deadlock will not occur. Hold and Wait - ANSWER - A process holding at least one resource is waiting to acquire additional resources held by other processes. In our dining philosopher's situation, deadlock can occur if everyone can pick up one fork and wait for another person's fork. No Preemption - ANSWER - a resource can be released only voluntarily by the process holding it, after that process has completed its task. If a process has to give up whatever resources it may have when it requests an additional blocked resource, deadlock can't occur. Circular Wait - ANSWER - If there's a cycle where P0 needs something from P1 which needs something from P2 which needs something from P0. (Cycle can go larger than that, just that's the idea.) This is what the graphs in slides 11-13 are demonstrating: no cycles in the graphs, no circular wait, no deadlock. Deadlock Handling - ANSWER - Prevent and avoid Detection and recovery Ostrich strategy Mutual Exclusion Fix - ANSWER - Holding is required for non-sharable resources (and hold and wait is another way that deadlock can occur) Hold and Wait Fix - ANSWER - Have to get all your resources before you can continue (have to get both forks before you can proceed), which can result in starvation or low

resource use. If everyone needs to have both forks to continue, there might be a lot of individual forks lying around that people can't use. No Preemption Fix - ANSWER - Make it so if there's something that's holding some resource and requests a blocked resource, it has to let go of everything. If someone has one fork and asks for a fork that is already being used, they have to put down their fork. Problems? Risk of starvation. Circular Wait Fix - ANSWER - Impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration. AKA P can't request processes from P0, only from P4 and above. There's a problem ________________. [The slides say there's a problem maybe but I don't know what it is.]