We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 20
A82-LIN-PH2-Types of Process Part-1 mmm «=
Eee ee
“Child Process: A process that is created by some other process during run-time. Usually child
processes are created to execute some binary from within an existing process. fork{) creates a child
process that differs from the parent process only in its PID and PPIDA82-LIN-PH2-Types of Process Part-1 mmm «=
Sa ea
Daemon Process: It is @ service process that runs in the background and supervises the
system or provides functionality to other process. These are system-related processes
‘that run in the background. A Daemon process can be recognized if it has “?” in its TTY.
field. Example ~ httpd service
siin@teamt-pacbe- Desktop - a
Fle Eat View Search Terma Help
[adningteant apache Geecktop}$ pe -p 2616 -\
F's MD’ PLD PEIN C PRI’ NI ADOA'S? MOHAN TTY ame cm
45 9 2015 1 8 Bo 8 - 81284 polls 7 (00:09:99 nttpa
[adnsneteant -apache Desktop]A82-LIN-PH2-Types of Process Part-1 mmm «=
Sa ea
"Orphan Process: When parent process gets killed the child processes become orphan and then
‘taken under by the Init process. Though the Init process takes the ownership of the orphan process
bbut still these process are called as orphan as their original parents no longer exists.
‘Stage #9 15) ‘Suge Zhou FO 8) ox. Stage 3: since PO 16 ro row
Sones od pest Teshid process D190 Tes puerta “asates” oy
agers pat ands Theat pens, wah
ow Stcones te pret
[==] »
GE) Cebie Process : A zombie process is one that should have closed, but is stil! active in the proce
This is usually caused when a parent process that spawned the process has not yet reali
it has completed, or wants to create another process of the same name without using the sa
fess ID.
oe ‘child
(Wahid ends normally exit0 |
| [[ichitd Killed by signals |
‘aus during this peri.
unig without ifthe paren doesnt eat
‘eyeing ens process the en ni say 2ombe
‘status forever.
| - aw Suy zombie]{tch or Automatic process : Automatic or batch processes are not connected to a terminal. Rat!
se are tasks that can be queued into a spooler area, where they wait to be executed on a FIFO|
st-in, first-out) basis. Such tasks can be executed using one of two criteria
ta certain date and time, done using the at command, which we will discuss in the second pa
his chapter.
times when the total system load is low enough to accept extra jobs done using
fhe batch command. By default, tasks are put in a queue.
schedule ta2k at coming 10.00 AM
schedule task ct 10:00 AM on coming Sunday.
t
Schedule task ot 000 AMon coming 25th Julyactive process : Interactive processes are initialized and controlled through a terminal sessi
her words, there must be someone connected to the system to start these processes; they
tarted automatically as part of the system functions. These interact constantly with their ust
herefore spend a lot of time waiting for key presses and mouse operations.
time process : the scheduling algorithm, or the thinking the kernel does when it decides wh|
less gets to run. A real time process will preempt all other processes when an interrup
ived, and it needs to runAB2-LIN-PM3-Process Scheduler mmm «=
EC eet
Linux Process Scheduler
Process Scheduling :
*= The scheduler isthe component ofthe kernel that selects which process to run next.
«Scheduling refers tothe way processes are assigned to run onthe avalable CPUS
Functionality of Scheduler
* CPU utilization: To keep the CPU as busy as possible.
"+ Throughput _: Number of processes that complete their execution per time unit.
‘Turnaround: Total time between submission of a process and its completion.
"= Waiting time: Amount of time a process has been wating inthe ready queue
+ Rasponte time: Amount of time it takes from when a request was submitted unt the fist responce is produce.
‘Fairness: Equal CPU time to each thread.
LTAB2-LIN-PM3-Process Scheduler mmm «=
EC eet
‘Types of Scheduling
"FIFO : This is a rei
first done (first out).
‘RR: This is around robin type of scheduling, where each task gets a certain amount of time then
it must exit, yield control to the next task and get back into the task queue. This is a real time
scheduling priority. &
* Priority Based Scheduling : Assigns each process a priority, and scheduler always chooses process of
higher priority over one of lower priority
Priority. The FIFO term means the first started (first in) will be the
* Shortest Job First(SIF): is a non-preemotive discipline in which waiting job (or process) with the
‘smallest estimated run-time-to-completion is run nextABD-LIN-PIAA.
ler process Communication Part-1 Cama
Inter Process Management
"It isa set of techniques for the exchange of data
among multiple threads in one or more
processes.
Shared Memory - Communication between
processes using shared memory requires
processes to share some variable and it
completely depends on how programmer will
implement it.
urler process Communication Part-1 Cama
ABD-LIN-PIAA.
Message Passing ~ This model allows multiple
processes to read and write data to the
message queue without being connected to
each other. Messages are stored on the queue
until their recipient retrieves them
ur‘AB2-LIN-PH4-nter process Communication Part mmm «=
‘Methods of Inter Process Management
® Signals : A signal could be generated by a keyboard interrupt or an error condition such as the process
attempting to access @ non-existent location in its virtual memory. Signals are also used by the shells to
signal job control commands to their child processes,
eS & .
he
poms
eS
LT nah cnA82-LIN-PHA-Inter process Communication Part xm =
SN ele]
Pipes
"A pipe, as its name states, can be understood as @ channel with two ends. Pipe is actually
implemented using a piece of kernel memory. The system call pipe always create 2 pipe and two
associated fle descriptions, f4[0] for reading from the pipe and fd[1] for writing to the pipe
"Example: command | command2|... | command n> "$ sort record.tet | unig"
LT sain a‘AB2-LIN-PH4-nter process Communication Part-2 mmm «=
"Sockets
"IPC sockets enable channel-based communication for processes on the same physical device (host),
whereas network sockets enable this kind of IPC for processes that can run on different hosts
(Networking)
.
Pres A Pres
ote | cba +
Computer 2
LT cet mnt id‘AB2-LIN-PH4-nter process Communication Part-2 mmm «=
‘=Semaphores
*= Its. location in mernory whose value canbe tested and set by more than one process, The test and set operation
's, so faras each process s concerned, uninterruptible; once sterted nothing can stop it.
*= Semaphores can be used to implement critica regions, areas of critical code that only one process at a time should
be executing. ——
‘ies ca coe
Demis
—=-|
ry
owe
Cees e
Seman
ses | St” Fist omer
[rere econ ba
amt 0
LT Sd‘AB2-LIN-FS4-Disk Paritioning and types of fles
Nt ered
Formatting the Partition
‘=Formatting is the process of preparing 2 data storage device such as a hard disk
drive, solid-state drive, floppy disk or USB fiash drive for intial use
‘Types of Formatting:
area ial)
‘+ Forming the tracks and sectors * Creating the file system on the
con the device device to store the data
+ Done by manufacturer * Done at OS level
LT nite ents‘AB2-LIN-FS2-Directory Stucture in Linux mmm «=
Linux Directory Structure
ul amine a iAB2-LIN-FS3-Structure of Ext File systern Part-L
Block Groups
‘Boot Block:
+The boot block wil maintain the boot sectors information
‘Super Block:
‘The super block records various information about the enclosing file system, such as block counts,
inode counts, supported features, maintenance information, and more
Group Descriptors:
‘she standard configuration is for each block group to contain @ full copy of the block group
descriptor table
+The group descriptor records the location of both bitmaps and the inode table
Data Block Bitmay
‘The data block bitmap tracks the usage of data blocks within the block group
* One bit represents the usage status of one data block
LTABD-LIN-FS3-Stucture of Ext File system Part-2
Po Nee eae
Block Groups
*Inode Bitmap:
+ inode is a data structure used to represent a file system object
+The inode bitmap records which entries in the inade table are in use
* One bit represents the usage status of one inode table entry
"Inode Table:
+ Inode table will have a list of inodes. The inodes are placed in se
the same number of inodes and is placed at a diferent blocks group
+ Fach inode table Is accessed from the group descriptor of the specific blocks group.
tables, each of which contains
"Data Blocks:
+ The data blocks will contain the actual contents of files
ut - :/AB2-LINLFS3- Structure of Ext File systom Part 3 mmm «=
eee i
Allocation of Blocks
‘*Ext4 first uses mult-block allocator
+ Allocates many blocks in 2 single call, instead ofa single block per call
+ Allocates large number of free continuous blocks for a fil.
‘"Exté uses Delayed allocation
“+ When a file needs more blocks for file writes, the fle system defers deciding the exact location on the
disk until al the dirty buffers are being written out to disk
“ Not committing to a particular location on disk until it's absolutely necessary is that the file system can
make better location decisions
"Exté tries to keep a file's data blocks in the same block group as its inode. This cuts down the
W/O operations time
‘*When feasible, all the inodes in a directory are placed in the same block group as the director/AB2-LINLFS3- Structure of Ext File systom Part 3 mmm «=
Percocet
Extents
An extent is simply a set of blocks which are logically contiguous in a file system
*In Ext4 the file to logical block map has been replaced with an extent tree
‘The inode must have the extents flag set for this feature to be used
*Storing the file structure as extents will result in significant compression of the file's
metadata, since @ single extent can replace a large number of block pointers
'=The reduction in metadata will enable faster access