Chapter 3: Processes

Get Started. It's Free
or sign up with your email address
Chapter 3: Processes by Mind Map: Chapter 3: Processes

1. Process

1.1. A program in execution, executed in sequential form

1.2. either

1.2.1. I/O bound process

1.2.1.1. spends more time doing I/O than computations

1.2.1.2. many short CPU bursts

1.2.2. CPU-bound process

1.2.2.1. Frequent computations

1.2.2.2. few long CPU bursts

2. Process in Memory

2.1. Stack

2.2. Heap

2.2.1. Memory dynamically allocated during runtime

2.3. Data Section

2.3.1. Global variables

2.4. Text Section

2.4.1. Contains Program code

2.5. PC and Registers

3. Process State

3.1. Process changes state as it executes

3.2. New

3.2.1. Process is being created

3.3. Ready

3.3.1. Waiting to be assigned to processor

3.4. Running

3.5. Waiting

3.6. Terminated

4. Process Control Block (PCB)

4.1. Stores information associated with each process

4.2. Process State (running, waiting...)

4.3. Process number (ID)

4.4. Program Counter

4.5. CPU Registers

4.5.1. content of all process-centric registers

4.6. CPU scheduling information

4.7. Memory-management information

4.8. Accounting information

4.9. I/O status information

5. Process Scheduling

5.1. Goal: Maximize CPU usage

5.2. Process Scheduler

5.2.1. Short-term scheduler / CPU scheduler

5.2.1.1. selects which process should be executed next on CPU

5.2.1.2. Invoked frequently (milliseconds)

5.2.2. Long-term scheduler / Job Scheduler

5.2.2.1. selects which processes should be brought into ready queue

5.2.2.2. Invoked infrequently (seconds, minutes)

5.2.2.3. Controls degree of multiprogramming

5.3. Scheduling Queues

5.3.1. Job Queue

5.3.1.1. All processes in the system

5.3.2. Ready Queue

5.3.2.1. All processes in main memory waiting to execute

5.3.3. Device Queues

5.3.3.1. Processes waiting for a specific I/O device

5.3.4. Processes migrate among queues

5.4. Context Switch

5.4.1. When switching processes, system must save state of current process and load saved state of the new one

5.4.2. Switch time is pure overhead and should be minimized (don't overcomplicate PCBs!)

6. Operations on Processes

6.1. Process Creation

6.1.1. Parent process creates child processes, forming a tree

6.1.1.1. Resource sharing options

6.1.1.1.1. P & C share all resources

6.1.1.1.2. C share subset of P's resources

6.1.1.1.3. P & C share no resources

6.1.1.2. Execution options

6.1.1.2.1. P & C execute concurrently

6.1.1.2.2. P waits for C to terminate

6.1.2. Process identified and managed through PID

6.2. Process Termination

6.2.1. Returns status data to parent

6.2.2. Process asks for deletion with exit( ) syscall

6.2.3. Parent aborts children with abort( ) syscall

6.2.3.1. Children no longer needed

6.2.3.2. Child is exceeing allocated resources

6.2.3.3. Parent is terminating

6.2.4. Some OSes don't allow children with dead parents to exist :(

6.2.4.1. Cascading Termination

7. Interprocess Communication

7.1. Processes can be cooperating

7.2. Shared Memory

7.2.1. Area of memory is reserved for processes

7.2.2. Communication is under control of the user processes

7.2.3. Issue: synchronization!

7.3. Message Passing

7.3.1. OS provides mechanisms for processes to communicate and synchronize their actions

7.3.1.1. send(message)

7.3.1.2. receive(message)

7.3.2. Processes need to establish a Communication Link

7.3.2.1. Logical

7.3.2.1.1. Direct/Indirect

7.3.2.1.2. Synchronous/Asynchronous

7.3.2.1.3. Automatic/Explicit Buffering

7.4. Communication in Client-Server Systems

7.4.1. Sockets

7.4.1.1. one endpoint of a two-way communication link between two programs running on a network

7.4.1.2. Concatenation of IP and port

7.4.1.3. ports below 1024 are used for standard services

7.4.2. Remote Procedure Calls

7.4.2.1. abstracts procedure calls between processes over a network (?)

7.4.2.2. uses ports for service differentiation

7.4.2.3. Stubs

7.4.2.3.1. client-side stub locates server and marshalls parameters

7.4.2.3.2. server-side stub receives parameters and executed procedure

7.4.3. Pipes

7.4.3.1. Ordinary Pipes

7.4.3.1.1. cannot be accessed from outside the process that created it

7.4.3.1.2. Typically from parent to child

7.4.3.1.3. One way

7.4.3.2. Named Pipes

7.4.3.2.1. Can be accessed by other processes

7.4.3.2.2. Two way