Process States What is a Process?
3.1.2 Process States
The process changes its state over time One of the important items in the PCB is the process state. Processes change state during their execution, sometimes by themselves e.g. by making a system call, and sometimes due to an external event e.g. when the CPU gets a timer interrupt. The following graph shows the main states and transitions: running ready blocked schedule preempt wait for event event done terminated created Processes are created in the ready state. A ready process may be scheduled to run by the operating system. When running, it may be preempted and returned to the ready state. A process may also block waiting for an event, such as an IO operation. When the event occurs, the process becomes ready again. Such transitions continue until the process terminates. Exercise 33 Why should a process ever be preempted? Exercise 34 Why is there no arrow directly from blocked to running? Exercise 35 Assume the system provides processes with the capability to suspend and resume other processes. How will the state transition graph change? Note that the states pertain to the process or, as we’ll soon see, to a thread, not to the operating system. Graphically, processes may be represented by tokens that move from one state to another according to the possible transitions. At each moment, at most one process is in the running state, several may be ready to run but can’t because we only have one processor, and several may be blocked. The operating system mediates some of the transitions: it may do something, and as a result, change the state of a process. Technically, this may be done by moving the PCB of the process from one linked list to another, where one such list is the list of ready processes used by the scheduler, another is a list of blocked processes used by interrupt handlers, and so on. As processes may block for a variety of reasons, the blocked state may actually be implemented by multiple distinct lists. Real transitions between elements of the system may therefore actually look like this: 47 = process ready queue preemption CPU terminated new arrival waiting for disk waiting for terminal waiting for timer3.1.3 Threads
Parts
» | Komputasi | Suatu Permulaan
» Operating System Functionality | Komputasi | Suatu Permulaan
» Abstraction and Virtualization | Komputasi | Suatu Permulaan
» Hardware Support for the Operating System
» Roadmap | Komputasi | Suatu Permulaan
» Scope and Limitations | Komputasi | Suatu Permulaan
» Performance Metrics | Komputasi | Suatu Permulaan
» Statistical Characterization of Workloads
» Analysis, Simulation, and Measurement
» Modeling: the RealismComplexity Tradeoff
» Waiting in Queues Queueing Systems
» Queueing Analysis Queueing Systems
» Incremental Accuracy Simulation Methodology
» Workloads: Overload and Lack of Steady State
» Summary | Komputasi | Suatu Permulaan
» Process States What is a Process?
» Operations on Processes and Threads
» Multiprogramming and Responsiveness Having Multiple Processes in the System
» Multiprogramming and Utilization Having Multiple Processes in the System
» Multitasking for Concurrency The Cost
» Performance Metrics Scheduling Processes and Threads
» Handling a Given Set of Jobs
» Using Preemption Scheduling Processes and Threads
» Priority Scheduling Scheduling Processes and Threads
» Starvation, Stability, and Allocations
» Fair Share Scheduling Scheduling Processes and Threads
» Concurrency and the Synchronization Problem
» Mutual Exclusion Algorithms Mutual Exclusion for Shared Data Structures
» Semaphores and Monitors Mutual Exclusion for Shared Data Structures
» Locks and Disabling Interrupts
» Deadlock and Livelock Resource Contention and Deadlock
» A Formal Setting Resource Contention and Deadlock
» Deadlock Prevention, Avoidance, and Detection
» Real Life Resource Contention and Deadlock
» Mapping Memory Addresses | Komputasi | Suatu Permulaan
» Support for Segmentation Segmentation and Contiguous Allocation
» Algorithms for Contiguous Allocation
» Address Translation Paging and Virtual Memory
» Algorithms for Page Replacement
» Swapping | Komputasi | Suatu Permulaan
» Links Alternatives for File Identification
» Data Access Access to File Data
» Caching and Prefetching Access to File Data
» Memory-Mapped Files Access to File Data
» Mapping File Blocks Storing Files on Disk
» Reliability Storing Files on Disk
» Levels of Security System Security
» Mechanisms for Restricting Access
» User Identification | Komputasi | Suatu Permulaan
» Controling Access to System Objects
» Virtualization | Komputasi | Suatu Permulaan
» Resource Management | Komputasi | Suatu Permulaan
» Reduction Hardware Support and Co-Design
» Booting the System | Komputasi | Suatu Permulaan
» Timers Kernel Priorities Context Switching
» Kernel Address Mapping Making a System Call
» Error Handling | Komputasi | Suatu Permulaan
» Parallelism vs. Concurrency Kernel Locking Conflicts SMP Scheduling Multiprocessor Scheduling
» Supporting Multicore Environments System Composition
» Code Structure Monolithic Kernel Structure
» Microkernels | Komputasi | Suatu Permulaan
» Extensible Systems | Komputasi | Suatu Permulaan
» Naming | Komputasi | Suatu Permulaan
» Remote Procedure Call Message Passing
» Streams: Unix Pipes, FIFOs, and Sockets
» Shared Memory Programming Interfaces
» Distributed System Structures | Komputasi | Suatu Permulaan
» Example Client-Server Systems | Komputasi | Suatu Permulaan
» Middleware | Komputasi | Suatu Permulaan
» Protocol Stacks Communication Protocols
» Error Correction Implementation Issues
» TCP Congestion Control Implementation Issues
» Authentication Authentication and Security
» Security Authentication and Security
» Networked File Systems | Komputasi | Suatu Permulaan
» Load Balancing | Komputasi | Suatu Permulaan
» Requirements Scheduling in Real-Time Systems
Show more