Escolar Documentos
Profissional Documentos
Cultura Documentos
19 de agosto de 2010
2 Escalonamento de Processos
Introdução ao Gerenciamento de
Processos
Gerente de Processos
Tarefas incluem:
Algoritmos e estruturas de dados para implementar processos e
abstrações de recursos;
Escalonamento de processos;
Sincronização de processos;
Estratégia para tratamento de bloqueios perpétuos (deadlocks);
Parte dos mecanismos de proteção e segurança.
Processos
Um processo possui:
1 Seção de texto (código);
2 Contador de instruções;
3 Pilha;
4 Seção de dados.
Descritor de Processo
Espaço de Endereçamento
Conjunto de localizações utilizado pelo processo para referenciar
posições de memória primária, serviços do SO e recursos;
Boa parte do espaço de endereçamento corresponde a localizações de
memória primária.
Threads
Threads
User
space
Thread Thread
Kernel
space Kernel Kernel
(a) (b)
Figura: (a) Três processos, cada um com um thread (b) Um processo com três
threads
2222222222222222222222222222222222222222222222222222222222222222222222222222
1 Per process items 1 Per thread items 1
1 Address space 1 Program counter 1
1 1 1
1 Global variables 1 Registers 1
1 Open files 1 Stack 1
1 Child processes 1 State 1
1 Pending alarms 1 1
1 Signals and signal handlers 1 1
Accounting information 1
112222222222222222222222222222222222222222222222222222222222222222222222222222
1
11
Four score and seven nation, or any nation lives that this nation who struggled here here to the unfinished they gave the last full
years ago, our fathers so conceived and so might live. It is have consecrated it, far work which they who measure of devotion,
brought forth upon this dedicated, can long altogether fitting and above our poor power fought here have thus that we here highly
continent a new nation: endure. We are met on proper that we should to add or detract. The far so nobly advanced. resolve that these dead
conceived in liberty, a great battlefield of do this. world will little note, It is rather for us to be shall not have died in
and dedicated to the that war. But, in a larger sense, nor long remember, here dedicated to the vain that this nation,
proposition that all We have come to we cannot dedicate, we what we say here, but great task remaining under God, shall have
men are created equal. dedicate a portion of cannot consecrate we it can never forget before us, that from a new birth of freedom
Now we are engaged that field as a final cannot hallow this what they did here. these honored dead we and that government of
in a great civil war resting place for those ground. The brave It is for us the living, take increased devotion the people by the
testing whether that who here gave their men, living and dead, rather, to be dedicated to that cause for which people, for the people
Kernel
Keyboard Disk
Dispatcher thread
Worker thread
User
space
Kernel
Kernel space
Network
connection
Escalonamento de Processos
Filas de escalonamento
Escalonadores
Preempção
Troca de Contexto