Operating Systems - General Concepts
45 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What principle of condition synchronization involves checking and blocking at specific locations?

  • Check and block (correct)
  • Wait indefinitely
  • Signal waiters
  • Access shared resources

Which of the following is NOT a characteristic of streaming communication?

  • Sequential data transmission
  • Use in multimedia applications
  • Coupling of senders and receivers (correct)
  • Variable message structures

Which of the following is a key advantage of using multiple threads over multiple processes?

  • Increased shielding from errors
  • Natural program structuring (correct)
  • Greater potential for distribution
  • Enhanced process isolation

What are the first and last steps in a conditional critical region?

<p>Lock and Unlock (C)</p> Signup and view all the answers

Which category is NOT part of the classic classification of input/output devices?

<p>Network devices (C)</p> Signup and view all the answers

At what level is a unified interface provided to applications for standardization of input/output devices?

<p>OS/API level (B)</p> Signup and view all the answers

What is a primary purpose of buffering in a kernel?

<p>Addressing speed differences (B)</p> Signup and view all the answers

What characterizes a set of tasks as being deadlocked?

<p>All tasks are waiting for one another (B)</p> Signup and view all the answers

What is generally a better practice when loading a new page in a virtual memory system?

<p>Overwrite an unmodified page. (B)</p> Signup and view all the answers

Under which condition is busy waiting considered acceptable?

<p>When there are no other tasks to execute on the processor. (D)</p> Signup and view all the answers

What is a significant disadvantage of memory-mapped I/O?

<p>It consumes address space. (B)</p> Signup and view all the answers

Which of the following advantages does dynamic partitioning have over fixed partitions?

<p>It reduces fragmentation. (D)</p> Signup and view all the answers

What conflicting requirements influence the choice of page size in a virtual memory system?

<p>It should be a power of two to facilitate addressing and small to minimize internal fragmentation. (C)</p> Signup and view all the answers

What is the main purpose of scheduling in an operating system?

<p>To allocate resources to tasks. (D)</p> Signup and view all the answers

What defines a task attribute in the context of scheduling?

<p>A property a task possesses. (A)</p> Signup and view all the answers

What occurs during a context switch in an operating system?

<p>It saves the context of one process and loads another. (C)</p> Signup and view all the answers

Which statement best describes the many-to-one multi-threading mapping model?

<p>All user threads are executed by a single kernel thread. (C)</p> Signup and view all the answers

What is a scheduling metric used for?

<p>To measure the attributes of a given task. (C)</p> Signup and view all the answers

What is the primary advantage of using Direct Memory Access (DMA)?

<p>It allows for parallel tasks between memory transfers and processor execution. (D)</p> Signup and view all the answers

What issue can arise when memory management swaps out a process that is waiting on an input operation?

<p>Another process's memory address space may be corrupted. (C)</p> Signup and view all the answers

Which characteristic differentiates stream I/O devices from block I/O devices?

<p>Stream I/O devices, such as keyboards and mice, handle data continuously. (A)</p> Signup and view all the answers

What is the primary function of an application programming interface (API) in relation to system calls?

<p>API provides a high-level interface for developers to perform operations. (A)</p> Signup and view all the answers

Which two methods allow a device driver to access device controller registers?

<p>Memory mapped I/O and Port-mapped I/O (C)</p> Signup and view all the answers

What crucial information does a process control block (PCB) contain?

<p>Information on the process's state and CPU context. (A)</p> Signup and view all the answers

What role does a context switch play in process management?

<p>It saves the state of the current process and initiates the next process. (D)</p> Signup and view all the answers

What distinguishes logical I/O from device I/O in an I/O subsystem?

<p>Logical I/O abstracts device details, while device I/O manages hardware interactions. (C)</p> Signup and view all the answers

Which of the following statements is true regarding interrupts and traps?

<p>An interrupt is a signal from I/O hardware that transfers control to an interrupt service routine. (B)</p> Signup and view all the answers

What is one advantage of using an API over direct system calls?

<p>APIs ensure portability across different operating systems. (A)</p> Signup and view all the answers

What differentiates a thread from a process?

<p>Threads share the same memory address space within a single process. (B)</p> Signup and view all the answers

What is the main purpose of the top half in interrupt handling?

<p>Quickly respond to the interrupt and prepare for another one (A)</p> Signup and view all the answers

Which RAID level primarily focuses on improving reliability through full copies?

<p>RAID 1 (A)</p> Signup and view all the answers

What does 'fairness' in concurrent processes refer to?

<p>No process should monopolize resources (B)</p> Signup and view all the answers

Which rule of thumb can help avoid deadlock in action synchronization?

<p>Ensure termination of critical sections (D)</p> Signup and view all the answers

Under what condition can an assignment in Pascal or C be considered atomic?

<p>When there is one reference to a variable and interrupts are managed correctly (B)</p> Signup and view all the answers

What is the primary goal of RAID level 5?

<p>Distribute parity to avoid hot-spots (C)</p> Signup and view all the answers

What common misconception might someone have regarding the bottom half of an interrupt handler?

<p>It directly interacts with user processes (D)</p> Signup and view all the answers

In the context of semaphore calls, which practice should be avoided to prevent deadlock?

<p>Creating cycles in semaphore usage (B)</p> Signup and view all the answers

What is a key difference between shared memory and message passing in inter-process communication?

<p>Shared memory reserves a region of memory accessible by both processes. (B)</p> Signup and view all the answers

Which statement correctly describes the process address space?

<p>It is a logical view of memory that is virtual and isolated for each process. (A)</p> Signup and view all the answers

What is an interrupt in the context of CPU processing?

<p>A signal to temporarily halt the current process to handle an event. (A)</p> Signup and view all the answers

How can internal fragmentation caused by small files in file systems be addressed?

<p>By implementing variable-sized blocks or including file content in descriptors. (B)</p> Signup and view all the answers

Which arbitration rule is typically applied when two processes have equal priority in CPU scheduling?

<p>The scheduling protocol must have predefined rules for tie-breaking priority. (C)</p> Signup and view all the answers

What happens during the handling of an interrupt?

<p>The CPU saves the state, executes an ISR, then resumes original processing. (A)</p> Signup and view all the answers

What is the result of using contiguous allocation for small files in a file system?

<p>It minimizes internal fragmentation for those files. (D)</p> Signup and view all the answers

Which of the following statements is true regarding CPU scheduling?

<p>Scheduling can occur under different conditions based on priority and timing. (C)</p> Signup and view all the answers

Flashcards

Thread-local variable

A thread that is accessible only by the thread that created it. Other threads cannot access or modify its data.

Mailbox communication

A mechanism where multiple processes or threads can communicate by sending and receiving messages through a common queue. This allows for asynchronous communication and decoupling of senders and receivers.

Deadlocked task set

A set of tasks is considered deadlocked when they are all waiting for each other to release a resource. None of the tasks can progress because they are all blocked.

Buffering in a kernel

A technique used in operating systems to temporarily store data in memory for faster access. Buffering allows data to be transferred between devices and applications without waiting for each other.

Signup and view all the flashcards

Condition synchronization

A set of rules for ensuring that only one thread can access a shared resource at a time, preventing data corruption and race conditions.

Signup and view all the flashcards

Streaming communication

A method of communication where data is sent in a continuous stream without a defined message structure. Often used for multimedia and real-time applications.

Signup and view all the flashcards

Message-based communication

A method of communication where data is sent in discrete messages with a defined structure. Often used for email and other message-based applications.

Signup and view all the flashcards

Standardization at OS/API level

A mechanism for integrating input/output devices into the operating system by defining a standard interface that applications can use to interact with devices.

Signup and view all the flashcards

Top Half of an Interrupt Handler

Tasks done by the device driver immediately after an interrupt, focusing on quick response and preparation for another interrupt.

Signup and view all the flashcards

Bottom Half of an Interrupt Handler

Tasks performed by the device driver after the immediate response to an interrupt, handling data processing and informing the OS.

Signup and view all the flashcards

Interference in Concurrent Processes

A situation where one process's assumptions about the state of shared resources are invalidated by actions of another process.

Signup and view all the flashcards

RAID Level 0

A method to improve performance by distributing data across multiple physical disks.

Signup and view all the flashcards

RAID Level 1

A method to enhance reliability by creating a full copy of the data on a separate disk.

Signup and view all the flashcards

Atomic Assignment in Programming

A programming practice that ensures a single instruction modifying a shared variable completes without interruptions.

Signup and view all the flashcards

Avoid Cycles in Semaphore Calls

A deadlock avoidance rule that emphasizes preventing circular dependencies among processes waiting for shared resources.

Signup and view all the flashcards

Fairness in Scheduling

A concept that refers to fairness in scheduling, ensuring that different processes or threads get a fair share of resources.

Signup and view all the flashcards

Why avoid replacing modified pages?

Replacing an unmodified page in memory with a new page avoids writing the old page to disk, saving time and resources.

Signup and view all the flashcards

When to replace a modified page?

Replacing a modified page is advisable when it's no longer needed and keeping it in memory provides no benefit. This frees up memory space for other pages.

Signup and view all the flashcards

When is busy waiting acceptable?

Busy waiting is acceptable when the waiting time is extremely short, typically in synchronization between processors within critical sections. It's used when the processor has nothing else to do while waiting.

Signup and view all the flashcards

Memory-mapped I/O advantage & disadvantage

Memory-mapped I/O unifies memory and I/O addressing, simplifying programming, but it consumes address space.

Signup and view all the flashcards

Port-mapped I/O advantage & disadvantage

Port-mapped I/O uses dedicated instructions for I/O operations, offering efficient use of instructions, but requires separate instructions for I/O, complicating programming.

Signup and view all the flashcards

Advantages of dynamic allocation

Dynamic allocation reduces fragmentation by allocating memory as needed, while efficient utilization avoids predefined partition sizes, allowing flexible allocation.

Signup and view all the flashcards

Requirements for page size choice

Page size should be a power of two for efficient hardware implementation. A large page size minimizes page table size, but increases internal fragmentation. A small page size reduces internal fragmentation but increases page table size.

Signup and view all the flashcards

What is scheduling and a schedule?

Scheduling determines how tasks are allocated to resources according to policies for competing tasks. A schedule maps tasks to resources at specific times.

Signup and view all the flashcards

Process Address Space

The portion of memory allocated to a process, providing a logical view of memory that's isolated and virtual.

Signup and view all the flashcards

Main Memory Address Space

The actual physical memory available in the system, shared by all running processes.

Signup and view all the flashcards

Interrupt

A signal sent from hardware or software to the CPU, temporarily halting the current process to handle a specific event.

Signup and view all the flashcards

Interrupt Handling

The interrupt handling process involves saving the current state, executing the interrupt service routine (ISR) - a specific code for the event, and then restoring the previous state to resume execution.

Signup and view all the flashcards

Problem with Small Files

When small files are stored in a file system, they often lead to internal fragmentation, wasting storage space due to unused space in fixed-sized blocks.

Signup and view all the flashcards

Optimizing for Small Files

Using inode structures with direct, indirect, and small block sizes to efficiently store smaller files, optimizing storage space.

Signup and view all the flashcards

CPU Scheduling

The process of making decisions about which process to execute next, based on factors like priority and available resources.

Signup and view all the flashcards

Shared Memory

A process that allows communication between different processes by providing a shared memory space accessible to both. This facilitates data exchange.

Signup and view all the flashcards

Process Memory Spaces

Each process has its own unique memory address space, preventing interference between processes.

Signup and view all the flashcards

DMA (Direct Memory Access)

DMA allows the processor to perform other tasks while data is being transferred between memory and I/O devices, improving efficiency.

Signup and view all the flashcards

Context Switch

A context switch involves saving the executing process's state (registers, PC, files, I/O status) in its Process Control Block (PCB) and loading the state of another process.

Signup and view all the flashcards

Stream vs. Block I/O

Stream I/O devices provide a continuous flow of data, such as keyboard input, mouse movements, sensor readings, and actuator commands. Block I/O devices transfer data in fixed-size blocks, like hard drives, SSDs, tapes, and USB sticks.

Signup and view all the flashcards

Swapping out a waiting process

Swapping out a process waiting for input can corrupt the memory address space of another process loaded in its place, as unexpected data changes may occur.

Signup and view all the flashcards

What is the relationship between API and system call interface?

The system call interface is the lowest level of abstraction for interacting with the operating system, translating high-level API requests into low-level OS instructions.

Signup and view all the flashcards

How can a device driver access device controller registers?

Memory-mapped I/O allows access to device registers as if they were memory locations. Port-mapped I/O uses specific I/O instructions to access registers directly.

Signup and view all the flashcards

What does a process control block contain?

A process control block (PCB) maintains vital information about a running process. This includes the process's current state, memory allocation, and resource usage.

Signup and view all the flashcards

What is a context switch?

A context switch involves saving the state of the currently running process and restoring the state of the next process scheduled to run.

Signup and view all the flashcards

What is logical I/O?

Logical I/O provides an abstract view of devices, allowing applications to interact with files and streams without worrying about specific hardware.

Signup and view all the flashcards

What is device I/O?

Device I/O manages low-level interactions with hardware devices through drivers, handling communication and data transfer.

Signup and view all the flashcards

What is an interrupt?

An interrupt is a signal from a device to the CPU, requesting attention. The CPU then transfers control to an interrupt service routine (ISR) to handle the interrupt.

Signup and view all the flashcards

What are the advantages of using an API?

APIs provide portability, ensuring code can run on different operating systems with minimal changes. APIs also simplify application development by abstracting complex system calls.

Signup and view all the flashcards

Study Notes

Operating Systems - General Concepts

  • Operating systems manage computer hardware and software resources
  • They provide an interface between applications and the hardware
  • They control processes, memory, files, and peripherals

Motivations for Operating Systems

  • Abstraction: hides complexity of low-level hardware from users
  • Concurrency: allows multiple tasks to run simultaneously
  • Portability: makes programs work on different hardware
  • Resource management: allocates and manages resources efficiently

Motivations for Multi-threading

  • Deal with natural concurrency (e.g., user interaction)
  • Improved performance on multi-processor systems
  • Hiding latency (e.g., I/O operations)

Blocking Factor in File Systems

  • Ratio of logical blocks to physical blocks
  • A measure of efficiency in file systems
  • A high ratio indicates a more efficient system

Synchronization Techniques

  • Busy waiting: a processor repeatedly checks a condition
  • Acceptable in situations with short wait times
  • Unacceptable for long wait times

Correctness Concerns in Concurrent Programs

  • Functional correctness (program does what it should)
  • Minimal waiting (processes wait minimum time)
  • Absence of deadlocks (processes don't get stuck)
  • Fairness (equal opportunities for all processes)

Kernel Return Path

  • Sequence of checks when resuming user-space execution
  • Execution after system calls or interrupts

Machine Instructions for Semaphores

  • Fetch&Add, Test&Set, Compare&Swap
  • Used for implementing synchronization mechanisms (semaphores)

Atomic Statements

  • Certain statements that are executed as a single, indivisible operation
  • Prevent issues like race conditions
  • Ensures data consistency

Concepts of Locality in Computer Systems

  • Spatial locality: accessing memory locations near previously accessed locations.
  • Temporal locality: accessing memory locations that were recently accessed.

Critical Sections

  • Blocks of code that modify shared resources
  • Important for synchronization/correctness
  • Must ensure only one process executes at a time

Multiprocessing Advantages

  • Error isolation (error in one process does not affect others)
  • Portability (program can be run on other machines)
  • Concurrency (multiple tasks run at the same time)

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

Explore the fundamental concepts of operating systems, including their role in managing hardware and software resources. This quiz covers key motivations for operating systems and multi-threading, as well as file system efficiency and synchronization techniques.

More Like This

Operating System Chapter 4: Threads
10 questions
Processes and Threads Overview
5 questions
Processi e Thread in UNIX
104 questions

Processi e Thread in UNIX

InvigoratingParable5805 avatar
InvigoratingParable5805
Use Quizgecko on...
Browser
Browser