¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

Processes and Threads

gunjan.thacker Inglés 1 página

Processes and Threads

Contenido del apunte (1)

Página 1

Processes

Process is an abstraction of a running program.

Even a CPU with a single core can switch between several processes quickly to give an illusion of parallelism called pseudo parallelism.

Process Model Every runnable program including the operating system is organized into a set of processes.

A process is an instance of running program and also keeps record of current values of program counter, registers and variables.

The CPU switches between different processes at a very high rate, hence the time taken by a process to do a task may not be same always. So processes must not be programmed with assumptions about timing. If they are programmed in this manner special steps need be taken for this.

Process Creation The following reasons may result in creation of a new process:

1. System Initialization

Many processes are created when a system is started. Some are foregrounded processes that interact with the user and some are background processes that do a specific job but the user doesn't see it. These background processes are called daemons.

2. Execution of a process creation system call by a running process.

A process may create another process to help it with the job at hand.

3. A User request to create a new process.

User runs a new program which means a new process is created.

4. Initiation of a batch job.

This is found in large mainframes where the user submits a batch job and the operating system decides when it has the available resources to do job then creates the process and runs the next from the input queue in it.

In general every new process is created by an existing running process whether it be a user created process or a system process or triggered by some input of keyboard or mouse.

Process Termination Process end in one of the following ways:

1. Normal Exit

When the process has done its job it executes a system call telling the operating system that it has finished and ends. (ExitProcess in windows and exit in unix)

2. Error Exit

Process discovers an error and exits.

3. Fatal Error

These are due to program bugs. In some cases we can program in such a way that if and when these errors occur instead of the operating system end the process it sends a signal to the process and the error can be handled within the program itself.

4. Murdered :D

Sometimes a process may execute a system call to kill another process for some reason. Of course it must have necessary authority to do so. In some cases when a process is killed all of its child processes are also killed.

Process Hierarchies

Processes and Threads

Información

Descripción
Apunte sobre Processes and Threads, creado por gunjan.thacker el 23/03/2015.
Creado por
gunjan.thacker
Visitas
12
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?