Tuesday, July 10, 2012
Processes in Operating Systems
PROCESSES
CONCEPT
A process is a running program, a processing unit managed by the OS's (Operating System).
The BCP (Process Control Block) is process information: allocated memory segments, open files, communication points.
HIERARCHY
When a process to Solita the OSs you create a process B, B is the son of A. In unix respected, not in winnt.
Processing environment
It consists of a set of variables that are passed to the process at the time of its creation (name-value table included in the process stack).
Process Group
Form groups with different properties, created from a shell, a terminal-dependent, and so on. There are operations that can be done on all processes of a particular group (kill everyone).
Multitasking
Single task, or single-process, only allows one process at every moment (MS-DOS)
Multitasking: o multithreaded several processes coexist at the same time, the OSs, divides the processor time to processes that everyone is moving in its execution.
Single User: supports a single user, single-process or can be multithreaded.
Multiuser supports multiple users working simultaneously in different terminals, it is mandatory multitasking.
PROCESS VOID
In the intervals in which the defendant has nothing to do, no OSs include a process is an infinite loop that does nothing useful (the goal is to "entertain" the processor).
PLANNER AND ACTIC
The planner (scheluder) comes running every time you turn on OSs and select the process to be run next. The activator (dispatcher) implements the scheduler process selected by him.
Degree of multiprogramming
The number of active processes that maintain the system. Significantly affects the performance of the computer. The more active processes, the greater probability of finding a state process ready to run, making the process run under zero. Mayor multiprogramming, greater need for Menorca.
Virtual memory:
Fully active processes residing in main memory, the degree of multiprogramming is limited by the size of the processes and memory.
With virtual memory:
Processes in main memory only have its resident set (pages that a process is in main memory) that makes room for more processes.
By increasing the number of processes decreases the resident set of each.
When the resident set becomes smaller than a certain value, I do not adequately represent the future working set (pages that a process is currently using) so that page faults occur.
Each fault is time consuming, the OSs have to deal with failure, making migration of pages, etc.., Failure to grow more dedicated system downtime to resolve them.
By increasing the degree of multiprogramming resident sets are becoming smaller and lower system performance to waste time paging.
Thrashing:
(Trashing) the state high paging sets produced when residents of the processes are too small.
Process Information
Processor state:
This consists of the contents of all registers (general registers, program counter, status registers, special registers)
Memory image of the process:
This consists of the memory space that is authorized to use.
Tables OSs:
Describe the processes and system resources.
FORMATION OF A PROCESS:
Is to complete all the information that is:
Assign a memory space to house the memory image.
Select a free BCP process table.
Fill in the BCP process information.
Load in the text segment the code and system routines in the data segment the initial data contained in the object file.
Current Status:
Execution:
When being executed by the processor, the state of the process lies in the processor registers.
Locked:
This event waiting to happen (ask operation E / S). The state lies in the BCP.
Done:
When you can enter the stage of processing. There may be several in this state, the scheduler decides which passes execution, the state lies in BCP.
They may also be on hold and suspended, to reduce the degree of multiprogramming, the OSs suspends the process, the area left in exchange. The goal is to leave enough memory to processes not suspended for a whole resident has adequate size and avoid thrashing.
CHANGING CONTEXT:
When an interrupt is carried out two operations:
Save the processor state in the corresponding BCP.
Runs interrupt handling routine of OS's.
As a result of the change of context, can produce some change in this process.
Lightweight process:
It's a running program that shares the memory image and other information with other lightweight processes. All LWPs of the same process share the same memory address space, code, data and batteries of different lightweight processes.
Allow to parallelize an application, if the program can be divided into procedures, the mechanism of light-weight processes can be launched simultaneously implementing them.
PLANNING:
Long-term:
It aims to add new processes to the system, taking them from the waiting list.
In the medium term:
Try the suspension process, decide which pass suspended and cease to be.
Short-term:
Select the process that is slated to move to implementation.
Scheduling algorithms:
Cyclic or Round Robin:
Equitable sharing of processor time. The processes are organized in a circular queue. A process remains running until it becomes blocked or when you consume your time shooting, drives and passes it to the bottom of the tail.
FIFO:
Takes to run the process at the head of the queue, it runs until it performs a blocking call.
Priorities:
Select the process in a ready state with the highest priority (batch). If they are fixed, they may suffer starvation, or that there is always a higher priority process to solve this applies an aging mechanism, each given amount of time increases its priority, once executed returns to its normal priority . If there are several with the same priority, you can use a cyclic algorithm is an interactive or batch FIFO if.
Shorter work first:
Demands to know before the time of execution of processes. Select a ready process with less runtime. There may also be starvation due to processes that can occur with shorter execution time.
Random or lottery:
Randomly choose the process to run.
Scheduling real-time systems:
The processes must be implemented in seconds defaults. They may be fixed-term period, the former running at any given time and the other repeatedly every so often.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment