3. Process - Intro
A process is the "heaviest" unit of kernel scheduling. ProcessResources include memory, file handles, sockets, device han
4. Process – Cont'd
Process:- Also called a task- Execution of an individual program- Can be traced list the sequence of instructions that executeProcess, on the other hand, includes:- Current value of Program Counter (PC)- Contents of the processors registers- Value of the variables- The process stack (SP) which typically contains temporary data s- A data section that contains global variables.
5. Identifier
State
Priority
Program Counter
Memory Pointer
Context Data
I/O Status Info
Accounting Info
…....
Process – Cont'd
While program is executing, this process can be c
Stored in data structure known as Process Cont
PCB is created for each process
The creation and management of PCB is done by
6. PROCESS STATES
lThe Creation and Termination of ProcesseslA Two-State Process ModellA Five-State ModellSuspended Processes
7. Process – The Creation
Submission of a batch jobUser logs onCreated to provide a service such as printingProcess (parents process) creates another procCalled as process spawning
8. Process – The Termination
Batch job issues Halt (OS service call for terUser logs offQuit an applicationError and fault conditions
9. Process – The Two State Model
l- Process may be in one of two stateslRunninglNot-running
10. The Two State Model – Cont'd
Dispatcher cannot just select the process that has been in th
Solution: split Not Running into two states:Ready – prepare to execute when given opportunityBlocked/Waiting – process cannot execute until some event o
11. Suspended Process
Processor is faster than I/O so all processes could be waitingSwap these processes to disk to free up more memoryBlocked state becomes suspend state when swapped to diskTwo new statesBlocked, suspend: blocked processes which have been swapReady, suspend: ready processes which have been swapped
13. Process Control – Modes of Execution
User mode
Less-privileged mode
User programs typically execute in this mode
System mode, control mode, or kernel mode
More-privileged mode
Kernel of the operating system
14. Process Control – Process Creation
Assign a unique process identifier
Allocate space for the process
Initialize process control block
Set up appropriate linkages
Ex: add new process to linked list used for scheduling queue
Create or expand other data structures
Ex: maintain an accounting file
15. Process Control – Switch a Process
Supervisor call
Requests I/O operation such as file open
Trap
error occurred from last instruction
may cause process to be moved to Exit state
Interrupt
event that is external to the running process such as completion of I/O
16. Type of Interrupts
Clock interrupt
process has executed for the maximum allowable time slice
I/O interrupt
I/O action has occurred
Memory fault
memory address is in virtual memory so it must be brought into main memory
17. Execution of the Operating System
Non-process Kernel (old)
execute kernel outside of any process
operating system code is executed as a separate entity that opera
Execution Within User Processes
operating system software within context of a user process
process executes in privileged mode when executing operating sy
Process-Based Operating System
major kernel functions are separate processes
Useful in multi-processor or multi-computer environment
19. Single Thread
Single threaded means there is only one thread within the processSingle threaded results in system idle time and user frustration. Fo
20. Multi Thread
In a multithreaded environment, a process is definedA virtual address space that holds the process image. Protected access to processors, other processes (for inter-p
22. Thread - Introduction
“One example of multithreading is when you are downloading a viYou can imagine multitasking as something that allows processesWhen multiple threads are running concurrently, this is known as m
23. How Multi Thread Works
The multithreading can help because usually a normal HTTP executionSo in practice when you have 1 request in which you need to fetch an i
25. How Multi Thread Works
The multithreading can help because usually a normal HTTP executionSo in practice when you have 1 request in which you need to fetch an i
26. Type of Multi Threading
Many To One
In the many-to-one model, many u
Thread management is handled b
However, if a blocking system cal
Because a single kernel thread ca
27. Type of Multi Threading
One to One
The one-to-one model creates a separate kernel thread to handle each
One-to-one model overcomes the problems listed above involving block
Linux and Windows from 95 to XP implement the one-to-one model for
28. Type of Multi Threading
Many to Many
The many-to-many model multiplexes any number of user threads onto a
Users have no restrictions on the number of threads created.
Blocking kernel system calls do not block the entire process.
Processes can be split across multiple processors.
29. Advantages
a. Responsive . Interactive applications to remain responsive even though theb . Resource sharing . Threads share memory and resources with other threadc . Economical . Making a process requires allocating need memory and resoud. Utilization of multiprocessor architectures . Advantage of multithreading can
30. Disadvantage
a. Kernel threads are generally slower to create and m
b. Transfer of control from one thread to another within
31. Symmetric Multi Processing
Symmetric Multiprocessing is a computer architecture of multiproc
Unlike asymmetric processing, any idle processor can be assigned
34. How SMP Works
In a symmetric multiprocessing environment, the CPU's share the same memo
Programs running on symmetric multiprocessing systems may experience a p
The effect in most applications is not so much a performance increase as the
35. How SMP Works Cont'd
Symmetric multiprocessing systems allow any processor to work o
36. Advantages
Symmetric multiprocessing is one of the cheapest ways to improve hardware performance. This
Symmetric multiprocessing is relatively easy to implement.
In situations where more than one program executes at the same time, a symmetric multiproces
37. Disadvantages
On personal computers, symmetric multiprocessing is less useful for applications that have not
It is useless if the system rarely runs more than one process at a time.
41. Microkernel Cont'd
Microkernel is the near-minimum amount of software that can provide the mechanis
A microkernel that is designed for a specific platform or device is only ever going to h
42. Microkernel Cont'd
Microkernel is the near-minimum amount of software that can provide the mechanis
A microkernel that is designed for a specific platform or device is only ever going to h
43. Advantages
Service separation has the advantage that if one service (called a server) fails others can still w
Only that driver need to be restarted rather than having the entire system die. This means more
Different services are built into special modules which can be loaded or unloaded when needed
Message passing allows independent communication and allows extensibility
The fact that there is no need to reboot the kernel implies rapid test and development.
Easy and faster integration with 3d party modules.
44. Disadvantages
Memory foot print is large
Potential performance loss (more software interfaces due to
Message passing bugs are not easy to fix
Process management is complex