1. PROCESS TERMINATION
1.1. DEFINITION
1.1.1. A process to indicates its completion
1.1.2. A batch job should include a HALT instruction or an explicit OS service call for termination.
1.1.3. For an interactive application, the action of the user will indicate when process is completed. (e.g. log off, quitting an application)
1.2. REASONS
1.2.1. 1) Normal Completion
1.2.2. 2) Time limit exceeded
1.2.3. 3) Memory unavailable
1.2.4. 4) Bounds violation
1.2.5. 5) Protection errors
1.2.6. 6) Arithmetic errors
1.2.7. 7) Time overrun
1.2.8. 8) I/O failure
1.2.9. 9) Invalid instructions
1.2.10. 10) Privileged instructions
1.2.11. 11) Data misuse
1.2.12. 12) Operator or OS intervention
1.2.13. 13) Parent termination
1.2.14. 14) Parent request
2. SUSPENDED PROCESS
2.1. SWAPPING
2.1.1. Involving moving part of all of a process from main memory to disk
2.1.2. None of the processes in main memory is in the Ready state,
2.1.3. the OS swaps one of the blocked processes out on to disk into a suspend queue.
2.2. CHARACTERISTICS
2.2.1. The process not immediately available for execution
2.2.2. The process was placed in a suspended state by an agent to prevent execution. e.g. an agent = itself , parent process, OS.
2.2.3. The process may or may not be waiting on an event.
2.2.4. The process may not be removed from this state until the agent explicitly orders the removal.
2.3. REASONS
2.3.1. Swapping - OS needs to release sufficient main memory to bring in a process that is ready to execute.
2.3.2. Other OS reason - OS may suspend a background or utility process or a process that is suspected of causing a trouble.
2.3.3. Interactive user request - User may wish to suspend execution program for purposes of debugging.
2.3.4. Timing - Process may be executed and suspended while waiting for the next time interval.
2.3.5. Parent process request - Parent process may wish to suspend execution of a descendant to examine or modify the suspended process or to coordinate various activity of a descendant.
3. DIFFERENCE
3.1. PROCESSES
3.1.1. The unit of resource ownership
3.1.2. Process includes a virtual address space to hold the process image.
3.1.3. Also known as task.
3.1.4. The unit of resource allocation and protection.
3.1.5. A virtual address space that holds the process image.
3.1.6. Protected access to:
3.1.6.1. Processors
3.1.6.2. Other processes
3.1.6.3. Files
3.1.6.4. I/O resources
3.2. THREADS
3.2.1. Scheduling/ Execution
3.2.2. Follows an execution path that may be interleaved with other process.
3.2.3. Has an execution state
3.2.4. The unit of dispatching
3.2.5. Also known as lightweight process
4. THREADS
4.1. DEFINITION
4.1.1. - The unit of dispatching
4.1.2. - Lightweight process
4.2. CHARACTERISTIC
4.2.1. - Has an execution state (e.g. Running, Ready, etc)
4.2.2. - Saved thread context when not running.
4.2.3. -An execution stack
4.2.4. -Some per-thread static storage for local variables
4.2.5. -Access to the memory and resources of its process (all threads of a process share this)
4.3. BENEFITS
4.3.1. Take less time to create a new thread than a process.
4.3.2. Less time to terminate a thread than a process.
4.3.3. Switching between two threads takes less time than switching between processes.
4.3.4. Threads enhance efficiency in communication between programs.
4.4. TYPES
4.4.1. Single Threaded Approaches
4.4.1.1. A single thread of execution per process, in which the concept of a thread is not recognized.
4.4.1.2. MS-DOS
4.4.2. Multithreaded Approaches
4.4.2.1. The ability of an OS to support multiple, concurrent paths, of execution within a single process
4.4.2.2. Java run-time
5. PROCESS MODELS
5.1. Two- State Process Model
5.1.1. RUNNING : Similar to Ready state which it has not been executed
5.1.2. NOT- RUNNING : The process is being executed.
5.2. Five- State Process Model
5.2.1. NEW : New request is made.
5.2.2. READY: Process is ready for execution
5.2.3. RUNNING: Process is being executed
5.2.4. BLOCKED: Process is in waiting state due to certain requests such as I/O completion.
5.2.5. EXIT: Process is terminated.
5.3. With One State Model
5.3.1. NEW: A new request is made.
5.3.2. READY: Process is ready for execution.
5.3.3. RUNNING: Process is being executed.
5.3.4. BLOCKED: Process is in waiting state due to certain request such as I/O completion.
5.3.5. SUSPEND: Swapping occurs to move process from main memory to hard disk.
5.3.6. EXIT: Process is terminated.
6. OPERATING SYSTEM CONTROL STRUCTURES
6.1. To manage processes and resources
6.2. OS constructs and maintain tables of information about each entity that it is managing.
6.3. Types of tables maintain by OS: - Memory tables - I/O tables - File tables - Process tables
7. PROCESS CONTROL BLOCK
7.1. contain process element
7.2. possible to interrupt a running process and later resume execution as if the interrupt had not occur
7.3. created and manged by the OS
7.4. IMPORTANT: It allows support for multiple processes
8. Process
8.1. DEFINITION
8.1.1. program in execution or an instance running program
8.1.2. a container for threads, which has its own memory
8.1.3. entity can be assigned to & executed on a processor
8.1.4. when the file loaded to RAM (must have state)
8.2. ELEMENTS
8.2.1. ESSENTIAL ELEMENTS
8.2.1.1. 1) Program code
8.2.1.1.1. shared with other processes that are executing the same program.
8.2.1.2. 2) A set of data associated with that code
8.2.1.2.1. processor begin to execute program code and refer the executing entity as a process
8.2.2. CONTAIN IN PROCESS CONTROL BLOCK
8.2.2.1. 1) Identifier
8.2.2.1.1. An identity of process to make a process unique, so that the OS can distinguish it among others.
8.2.2.2. 2) State
8.2.2.2.1. A state of process
8.2.2.3. 3) Priority
8.2.2.3.1. Level of priority of which process needs to be executed first
8.2.2.4. 4) Program Counter (PC)
8.2.2.4.1. Holds the address of next execution that needs to be referred to CPU
8.2.2.5. 5) Memory Pointers
8.2.2.5.1. Address that points to the program code and data associated with the process
8.2.2.6. 6) Context Data
8.2.2.6.1. Data present in registers while the process is executing
8.2.2.7. 7) I/O Status Information
8.2.2.7.1. Records down the details or info of I/O devices resources
8.2.2.8. 8) Accounting Information
8.2.2.8.1. Account of the process
9. OS Management of Application Execution
9.1. Resources available to multiple application.
9.2. The processor switched among multiple application to be progressing.
9.3. Processor and I/O device can be used efficiently
9.3.1. used efficiently - OS maximize the productivity, minimize the usage of resources.
10. PROCESS STATES
10.1. TRACE
10.1.1. The behavior of an individual process -list the sequence o instructions that execute for that process
10.1.2. The behavior of the processor- show how the traces of various process are interleaved
10.2. DISPATCHER
10.2.1. Small program - switches the processor from one process to another
11. PROCESS CREATION
11.1. DEFINITION
11.1.1. Occurs when a new process is to be added to those currently being managed processes
11.1.2. OS builds data structures that are used to manage the process and allocates address space in main memory to the process
11.2. REASONS
11.2.1. New batch job - It will read the next sequence of job control commands.
11.2.2. Interactive logon - A user at a terminal logs on to the system
11.2.3. Created by OS to provide a service - To perform a function on behalf of a user program, without the user having to wait.
11.2.4. Spawned by existing process - A user program can dictate the creation of a number of processes
11.3. TYPES
11.3.1. Process spawning
11.3.1.1. - when the OS create a process at the explicit request of another process
11.3.2. Parent process
11.3.2.1. - the original creating process
11.3.3. Child process
11.3.3.1. - the new process