Exam 1
Thread States
1. Spawn 2. Block 3. Unblock. 4. Finish
Process (vs thread)
A collection of one or more threads and associated system resources (such as memory containing both code and data, open files, and devices). This corresponds closely to the concept of a program in execution. By breaking a single application into multiple threads, the programmer has great control over the modularity of the application and the timing of application-related events.
Thread
A dispatchable unit of work. It includes a processor context (which includes the program counter and stack pointer) and its own data area for a stack (to enable subroutine branching). A thread executes sequentially and is interruptible so the processor can turn to another thread.
Process
A general term including: a program in execution, and instance of a program running on a computer, the entity that can be assigned to and executed on a processor, and a unit of activity characterized by a single sequential thread of execution, a current state, and an associated set of system resources
OS Memory Management
A key task of the OS. Keeping track of the use of the main memory (Registers, Cache and main memory). Allocates memory to programs. 5 principle storage management responsibilities: Process isolation, Automatic allocation and management, Support of modular programming, Protection and access control, and Long-term storage
Operating System (OS)
A program that controls the execution of application programs, and acts as an interface between applications and the computer hardware. It can be thought of as having three objectives: convenience, efficiency, and ability to evolve. The OS functions in the same way as ordinary computer software; that is, it is a program or suite of programs executed by the processor. The OS frequently relinquishes control, and must depend on the processor to allow it to regain control
Multithreading
A technique in which a process, executing an application, is divided into threads that can run concurrently
User-Level Threads (ULT)
All thread management is done by the application. The kernel is not aware of the existence of threads
Interrupt-driven I/O
An I/O scheme that employs interrupts to indicate to the processor that an I/O device needs attention.
Process
An entity that consists of a number of elements. Two essential elements of a process are program code (which may be shared with other processes that are executing the same program) and a set of data associated with that code.
Fault
An erroneous hardware or software state resulting from component failure, operator error, physical interference from the environment, design error, program error, or data structure error. Permanent or Temporary (Transient or Intermittent).
Control
An instruction may specify that the sequence of execution be altered. For example, the processor may fetch an instruction from location 149, which specifies that the next instruction be from location 182. The processor sets the program counter to 182. Thus, on the next fetch stage, the instruction will be fetched from location 182 rather than 150.
Monolithic Kernel
An operating system design where most of the operating system functionality is linked together inside the kernel
OS Security and Protection
Availability, Confidentiality, Data integrity, and Authenticity
MTTR (mean time to repair)
Average length of time required to perform a repair on the device
Integer format
Bit 0: S. Bits 1-15: magnitude
Instruction format
Bits 0-3: opcode. Bits 4-15: address
Fault tolerance
Built into a system by adding redundancy. Spatial (physical) or temporal.
CPU
Consists of PC, IR, execution unit, MAR, MBR, I/O AR, and I/O BR
Monitor (batch OS)
Contains the most frequently used functions in the OS and, at a given time, other portions of the OS currently in use.
Processor
Controls the operation of the computer and performs its data processing functions. When there is only one processor, it is often referred to as the central processing unit (CPU)
Processor-memory
Data may be transferred from processor to memory, or from memory to processor
Processor0I/O
Data may be transferred to or from a peripheral device by transferring between the processor and an I/O module
Nested interrupt processing
Define priorities for interrupts and to allow an interrupt of higher priority to cause a lower-priority interrupt handler to be interrupted
OS Scheduling and Resource Management
Fairness, Differential responsiveness, and Efficiency
Hardware failure
Generated by a failure, such as power failure or memory parity error
Timer
Generated by a timer within the processor. This allows the operating system to perform certain functions on a regular basis
I/O
Generated by an I/O controller, to signal normal completion of an operation or to signal a variety of error conditions.
Program interrupt
Generated by some condition that occurs as a result of an instruction execution, such as arithmetic overflow, division by zero, attempt to execute an illegal machine instruction, or reference outside a user's allowed memory space
Kernel Level Threads
In a pure KLT facility, all of the work of thread management is done by the kernel. There is no thread management code in the application level, simply an application programming interface (API) to the kernel thread facility
Kernel
In main memory; contains the most frequently used functions in the OS and, at a given time, other portions of the OS currently in use.
multicore processor
Integrated circuit to which two or more processors have been attached for enhanced performance, reduced power consumption and more efficient simultaneous processing of multiple tasks.
Cache memory
Intended to provide memory access time approaching that of the fastest memories available, and at the same time support a large memory size that has the price of less expensive types of semiconductor memories.
Modes of Execution
Most processors support at least two modes of execution. Certain instructions can only be executed in the more-privileged mode. These would include reading or altering a control register, such as the PSW, primitive I/O instructions, and instructions that relate to memory management. In addition, certain regions of memory can only be accessed in the more-privileged mode. It is necessary to protect the OS and key operating system tables, such as process control blocks, from interference by user programs. In the kernel mode, the software has complete control of the processor and all its instructions, registers, and memory. This level of control is not necessary, and for safety is not desirable for user programs
I/O modules
Move data between the computer and its external environment. The external environment consists of a variety of devices, including secondary memory devices (e.g., disks), communications equipment, and terminals. Consist of buffers
Swapping
Moving part or all of a process from main memory to disk. When none of the processes in main memory is in the Ready state, the OS swaps one of the blocked processes out on to disk into a suspend queue. This is a queue of existing processes that have been temporarily kicked out of main memory, or suspended. The OS then brings in another process from the suspend queue or it honors a new-process request. Execution then continues with the newly arrived process
Reasons for process creation
New batch job, interactive log-on, created by OS to provide a service, spawned by existing process
Five State Process Model
New: A process has been created but has not yet been admitted to the pool of executable processes. Ready: Processes that are prepared to run if given an opportunity. That is, they are not waiting on anything except the CPU availability. Running: Process that is currently being executed. Blocked/Waiting: A process that cannot execute until a specified even such as user input or reading a record from a file completes. Exit: A process that has been released by OS either after normal termination or after abnormal termination (error).
Reasons for process termination
Normal completion, Time limit exceeded, Memory unavailable, Bounds violation, Protection error, Arithmetic error, Time overrun, I/O failure, Invalid instruction, Privileged instruction, Data misuse, Operator or OS intervention, Parent termination, Parent request, certain error and fault conditions
Instruction action categories
Processor-memory, Processor-I/O, Data processing, and Control. An instruction's execution may involve a combination of these actions
I/O operation techniques
Programmed I/O, Interrupt-Driven I/O, and Direct Memory Access
Interrupts
Provided primarily as a way to improve processor utilization.
System bus
Provides for communication among processors, main memory, and I/O modules. Leads from the CPU and I/O module to the main memory
Multithreading
Refers to the ability of an OS to support multiple, concurrent paths of execution within a single process
Basic instruction cycle
Start, fetch next instruction (fetch stage), execute next instruction (execute stage), halt; with a feedback loop from the execute stage to the fetch stage
Main memory
Stores data and programs. This memory is typically volatile; that is, when the computer is shut down, the contents of the memory are lost. In contrast, the contents of disk memory are retained even when the computer system is shut down. Main memory is also referred to as real memory or primary memory. Consist of instruction layers on top of data layers from 0 to n-1
Microkernel
Structures the operating system by removing all nonessential components from the kernel and implementing them as system and user-level programs
Programmed I/O
The I/O module performs the requested action, then sets the appropriate bits in the I/O status register but takes no further action to alert the processor. In particular, it does not interrupt the processor. Thus, after the I/O instruction is invoked, the processor must take some active role in determining when the I/O instruction is completed. For this purpose, the processor periodically checks the status of the I/O module until it finds that the operation is complete.
Three-level cache organization
The L2 cache is slower and typically larger than the L1 cache, and the L3 cache is slower and typically larger than the L2 cache
MTTF (mean time to failure)
The average time to failure for a nonrepairable system
Process Control Block
The data structure used by the operating system to manage information about a process. It contains sufficient information so it is possible to interrupt a running process and later resume execution as if the interruption had not occurred.
Availability
The fraction of time the system is available to service users' requests. A=MTTFMTTF+MTTR
Instruction cycle with interrupts
The instructional cycle has the following main sequence: start, fetch next instruction, execute instruction, check for interrupt; initiate interrupt handler. The execute instruction also leads to halt
Instruction cycle
The processing required for a single instruction
Sequential interrupt processing (disabled interrupts)
The processor ignores any new interrupt request signal. If an interrupt occurs during this time, it generally remains pending and will be checked by the processor after the processor has reenabled interrupts. Thus, if an interrupt occurs when a user program is executing, then interrupts are disabled immediately. After the interrupt-handler routine completes, interrupts are reenabled before resuming the user program, and the processor checks to see if additional interrupts have occurred. This approach is simple, as interrupts are handled in strict sequential order
Data processing
The processor may perform some arithmetic or logic operation on data
Single-threaded process
The traditional approach of a single thread of execution per process, in which the concept of a thread is not recognized
The Memory Hierarchy
There is a trade-off among the three key characteristics of memory: capacity, access time, and cost. Faster access time, greater cost per bit. Greater capacity, smaller cost per bit. Greater capacity, slower access speed. From top to bottom: 1. Decreasing cost per bit 2. Increasing capacity 3.Increasing access time 4. Decreasing frequency of access to the memory by the processor
Multiprogrammed Batch Systems
This allows for the running of multiple programs at once. Specifically the one program can run when the other program is waiting on I/O
Multiple interrupts
Two approaches: disable interrupts or
Symmetric Multiprocessing (SMP)
Type of multiprocessing system where each processor performs all tasks, including operating system functions and user processes.
Two-State Process Model
We can construct the simplest possible model by observing that, at any time, a process is either being executed by a processor, or it isn't. In this model, a process may be in one of the two states: Running or Not Running
Direct Memory Access (DMA)
When a device controller transfers an entire block of data from its own buffer storage to memory without CPU intervention
Process spawning
When the OS creates a process at the explicit request of another process