Chapter 3: Processes

Começar. É Gratuito
ou inscrever-se com seu endereço de e-mail
Rocket clouds
Chapter 3: Processes por 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 spends more time doing I/O than computations many short CPU bursts

1.2.2. CPU-bound process Frequent computations 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 selects which process should be executed next on CPU Invoked frequently (milliseconds)

5.2.2. Long-term scheduler / Job Scheduler selects which processes should be brought into ready queue Invoked infrequently (seconds, minutes) Controls degree of multiprogramming

5.3. Scheduling Queues

5.3.1. Job Queue All processes in the system

5.3.2. Ready Queue All processes in main memory waiting to execute

5.3.3. Device Queues 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 Resource sharing options P & C share all resources C share subset of P's resources P & C share no resources Execution options P & C execute concurrently 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 Children no longer needed Child is exceeing allocated resources Parent is terminating

6.2.4. Some OSes don't allow children with dead parents to exist :( 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 send(message) receive(message)

7.3.2. Processes need to establish a Communication Link Logical Direct/Indirect Synchronous/Asynchronous Automatic/Explicit Buffering

7.4. Communication in Client-Server Systems

7.4.1. Sockets one endpoint of a two-way communication link between two programs running on a network Concatenation of IP and port ports below 1024 are used for standard services

7.4.2. Remote Procedure Calls abstracts procedure calls between processes over a network (?) uses ports for service differentiation Stubs client-side stub locates server and marshalls parameters server-side stub receives parameters and executed procedure

7.4.3. Pipes Ordinary Pipes cannot be accessed from outside the process that created it Typically from parent to child One way Named Pipes Can be accessed by other processes Two way