1/41
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the kernel?
- Core of an OS, intermediary between hardware and software
- manages resources and processes
- works in conjunction with the scheduler
- (works with) scheduler, dispatcher, signal handlers
- data structures: process table, open file table, other tables/bookkeeping data structures
Variables/characteristics involved in scheduling algorithms
- burst/cycle time*, arrival time*, quantum/quanta*, priority*, period*, (atomicity)
- waiting time/age*, queue size, deadline*, dependencies
What is the difference between a mutex lock and a semaphore?
- mutex lock: mutually exclusive lock (0,1), on or off, locked or unlocked
- one process accesses its critical section at a time
- semaphore: more advanced, yet more general
- allows for multiple resources to access their critical sections
Why are orphan and zombie processes so problematic in the operating system?
- zombies: they aren’t doing anything! Taking up resources despite done
- orphans: similar, now have to become a child of init
What is an operating system?
- software (multiple programs) that is the intermediary between software and hardware
- a system that acts in:
- resource allocation
- memory management
- user interface
- etc.
List the 5 process states
- New, running*, ready*, waiting*, terminated
What are some things that make threads much lighter than processes?
- Threads share resources in contrast to child processes which have their own PCB process (control block), program stack, etc./
- Less complex, the operations they perform are generally less memory-intense
- Reduced overhead with regards to the content switch (switching from one process to another)
- interthread communication is easier than interprocess communication (IPC)
Most user processes live in what ring of the OS security rings model? Why is that?
- Ring 3 (highest ring, least amount of OS privilege)
- Ring 2 - device driver extensions
- Ring 1 - drivers
- Ring 0 - the kernel (hardware)
What is a system call? What are some examples of system calls?
- A request from an application to the kernel for (something) (Ex. hardware, CPU time, attention)
- A function
- fork(), sleep(), exit(), open(), read(), write(), …
P1 has 5 steps (a,b,c,d,e) and P2 has 4 steps (a,b,c,d). Assuming all suboperations are the same size, which is more atomic?
- P2 is more atomic
- atomicity: (smallest it can be reduced to) the measure of irreducibility in a process
- something that is more atomic than something else is “easier to package up” into one step
System calls are functions called in a program that force the operating system to partition the disk. (T/F)
False
Processes that are considered "multithreaded" create several instances of itself to perform different tasks, and have one program counter per thread. (T/F)
True
What do operating system data structures use to communicate between each other and other process?
interrupts
The primary type of multitasking in an operating system, also known as concurrent programming, is mainly referred to as:
multiprocessing
Which of the following data structures does the operating system utilize to keep track of things like files and processes?
hash maps, linked list, binary trees (all of the above are used by the OS)
Select all of the responsibilities of the operating system.
allocate resources for individual processes
work with the kernel to interpret I/O signals
manage memory aross the system to optimize the transfer of data
maintain data structures like the process table and device table
process signals from system calls
Which scripting language allows programmers to call programs from inside their script files?
batch script and BASH
BASH script files must be prefixed with a line or lines pointing the OS to the right script interpreter. (T/F)
True
Processes that run indefinitely in the background and typically are hidden by the operating system are referred to as:
daemon processes
System call implementation is the same across all operating systems. (T/F)
False
Which system call allows the user to create a process from another process?
fork()
System calls are part of a(n):
API (Application Program Interface)
Which OS mode interacts with the hardware?
kernel mode
System calls are function calls that allow the programmer to interact with OS resources more closely. (T/F)
True
Parent processes spawn:
child processes
The context switch is a register in the system which flips on for if a process is running and off for is a process is waiting. (T/F)
False
A process has asked the user to enter their name as part of a C program. This process is in what state?
waiting
Which type of process takes up space on the system despite being terminated?
zombie process
The OS stores processes:
hierarchically, like a tree
In the context switch, the OS saves:
the state and information of the two processes involved in the switch
A process is using up time and resources on the CPU to calculate the one millionth digit of pi. Which process state would it be in?
running
Processes that need information from one another engage in IPC, or interprocess communication. (T/F)
True
Which two entities facilitate IPC?
sockets and pipes
The process scheduler is a program in the OS which determines which processes get time and resources from the CPU. (T/F)
True
Kernels are typically not multithreaded because concurrency allows for different process contexts to be switched on easily. (T/F)
False
Which of the following entities processes interrupts sent from one multithreaded process to another to facilitate communication?
signal handler
Threads are considered heavyweight structures. (T/F)
False
What is one problem from using threads?
shared space and resources lead to inconsistencies in data
Parallelism allows for multiple processes to actually run at the same time in multicore systems where concurrency allows for one process at a time to make progress, simulating parallelism in single processor systems.
True
Threads are typically created programmatically, via a(n):
API
Threads are implemented differently by different operating systems and different programming languages because:
each OS's internal communication protocols are different; threads might require more or less resources in a different environment
The register set, stacks, and private storage area are known as the context of the thread, and is therefore subject to a context switch. (T/F)
True