0% found this document useful (0 votes)
14 views

Process

1. The document discusses processes including definitions, status, images, execution modes, concurrency, and relationships between processes. 2. It also covers process management topics such as creating and terminating processes, switching contexts, scheduling, communication, synchronization, and deadlocks. 3. Key aspects of processes include program code, data, stack, process attributes stored in the process control block, and various status like new, running, waiting, ready, and terminated during the lifecycle.

Uploaded by

gekmasratihap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Process

1. The document discusses processes including definitions, status, images, execution modes, concurrency, and relationships between processes. 2. It also covers process management topics such as creating and terminating processes, switching contexts, scheduling, communication, synchronization, and deadlocks. 3. Key aspects of processes include program code, data, stack, process attributes stored in the process control block, and various status like new, running, waiting, ready, and terminated during the lifecycle.

Uploaded by

gekmasratihap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Process

1
Outline
n Process
n Proses : review
n definition process
n Process status
n Image proses
n Execution mode
n Conccurency
n Relation between process
n Proses: Management
n creating and terminated proses
n switching proses and context
n Process scheduling
n communication proses
n Sycronization process
n Deadlocks
Pengantar Sistem
Operasi 2
Proses: Definition
nDefinisi Umum:
Process / job / task is a program that is being executed
in a state or active.
Process vs program
A process is more than just the program code. Two
different processes can run the same program code in
memory, but it has the status and attributes of different
processes. Thus, the program is a passive entity, while
the process is an active entity.

n includes program code, data, stack and process


attributes (id information process, the status of the
process, the use of resources such as memory, I / O,
file, etc.).
3
Process: Status
n What? process status can be defined as a state of
ongoing activity of a process.
n In the life cycle of a process, the type of status are:
n New : The process of being created or initialized.

n Running : Instruction of the process being executed.

n Waiting : The process was waiting for an event

n Ready : Process is ready to be activated (to the


running status).
n Terminated:The process has completed its
execution.
n Multi-programming OS execution cycle processes
interchangeably (interleaving), so that a process have
various statuses in its life cycle.
4
Gambar. Siklus hidup dan status dari suatu proses
MENJADI
DARI
New Ready Running Blocked Exit
OS menciptakan OS X X X
proses sebagai mempersiapkan
respon permintaan untuk
New job control; pemakai menambahkan
log-onI ke sistem proses
Time-sharing; proses
menciptakan child
X X Terpilih oleh X Proses
Dispatcher dihentikan oleh
Ready sebagai proses parent
berikutnya yang
dijalankan
X Time-out; meminta X Meminta Proses selesai;
layanan OS; OS layanan OS; proses dibatalkan
memilih proses meminta sumber
Running dengan prioritas daya; meminta
lebih tinggi; proses event
melepaskan
kendali
X Terjadi event yang X X Proses
Blocked ditunggu dihentikan oleh
parent

Gambar. Pemicu Transisi status proses


Proses: Image (1/2)
n What? Image proses is virtual memory space allocated
to a process.
n Content? image The process consists of elements:
n PCB (Process Control Block)

storing the attributes of the process, it takes the OS


to control the process
n User Program

storing program code which is executed


n User Data

storing program data (variable value), data is


modified
n System Stack

Save parameter from procedure or system call


7
Proses: Image (2/2)
n PCB (Process Control Block) contains a description
of the attributes of the process.
n Information in a PCB can be categorized :
n Identity information process
ID proses, ID parent, ID pemakai
n CPU status information process
PC and Register
n Information process control
Process status, priority scheduling, process privileges,
use of resources (memory, I / O, CPU time, files), etc.

8
PCB Pointer Status Proses
(Process Control Block )
ID Proses
ID Proses parent, dll
PC (Program Counter)
User Stack
Register CPU

Private User Address Space Limit Memori


(Program, Data)
List file yang dibuka

.
.
Shared Address Space .

Gambar. Struktur Image proses Gambar. Diagram PCB


Process: Concurrency
n The process can be run in two kinds of
modes :
n System/Monitor/Kernel Mode
Applies to the execution routines (process) of
the OS, such as routine for memory
management, device I / O or management
process.
n User Mode
Applies for program execution (process) of
the user (user)
10
Process: Concurrency
n Definition:
Concurrency is a situation where two or more
processes running at the same time.
n Simultaneously means an active process can be
run without having to wait for others to finish
the whole process. On systems that do not
concuren, other processes can be executed only
if the previous process has been completed.

11
Process: Concurrency
n Mechanism : Concurrency are the foundation of
multiprogramming. In a single processor system,
concurrency is implemented by performing interleave
processes, whereas the multiprosesing systems,
interleave and overlap conducting by processes that
was active.

n Problem: processes that concurren require special


handling such as scheduling (because competition
processor time), synchronization (if interplay),
communication (if mutually cooperate), and deadlock
handling (due to competition of using resource).

12
Gambar. Proses konkurens pada sistem single dan multiprosesor
Relation between process
n Relation between concurren process, Relations between
concurrent processes, in terms of the effect of one another,

n Independent or separate (independence),


processes are not mutually aware and do not affect each
other.
n Indirectly affect each other,
processes are not mutually aware but affect each other
because resource sharing.
n Cooperate,
namely the process -the process consciously work together and
affect each other.

14
Management: Process
• OS tasks in relation to the management
process:
– Control cycle such as the creation process, delays
and termination process by the user and the
system..
– Supporting communication between processes,
thus helping in the preparation of the application..
– Rotate or to schedule execution of a number
processes to maximize processor utilization, while
providing a good time.
– Regulate the allocation of resources in accordance
with the policy process so that each process is
running correctly and to prevent deadlocks.
15
Process: Creating
n Creation (creation) process can be caused
by :
n New batch job execution
n Users log on to the interactive environment
n Responses OS on demand service
n The process creates another process (child process)

n Phase creating process includes :


n Gives the identity (ID) in the process and insert a
new entry to the list or table process.
n Memory allocation for processes (process image)
n Initialization PCB, ie set the status of the process, the
initial priority, etc.
n Insert the entry process to the queue (queue sets of
16
links)
Process: Terminated(1/2)
n Termination process can be caused:
n The process has been completed (by calling the exit system call)
n Total time limit has passed
n memory shortage
n Memory limit violation
n Protection violation or resource file
n arithmetic error
n The failure of the I / O (not locate the file or failed read)
n Instructions that are not true
n Usage instructions are not permitted.
n Misuse of data
n The intervention of the operation or the operating system
n The parent process (parent) ends
n At the request of the parent process

17
Process: Termination(2/2)
n Termination phase process include :
n Restoring data output to the parent process.
n Remove processes from the list or table process
n Removing the PCB and also image process.

18
Process: Switching(1/2)
n Diversion (switching) process can be caused :
n Interrupt
Exp: Clock, I/O, Memory fault interrupt. caused switching
to the interrupt handler(interrupt routine )
n Trap
Special interruptions that occur because of the
condition of the exception (exception condition)
generated processes running
n Supervisor Call
Calling service by the operating system. The effect is
the process become blocked due to an active status
in the kernel (OS).

19

You might also like