Beruflich Dokumente
Kultur Dokumente
com
Some disadvantages
Lengthier Code when using Template,Multiple Inheritance (Deriving a class frommany parents),
Exceptional handling, Virtualbase classes and classes for IO Streams.
UNIT IV
Process Concepts
www.Vidyarthiplus.com
Modulating process,
Display process,
GUIs (graphic user interfaces), and
Key input process for provisioning of the user interrupts
A data structure having the information using which the OS controls the
Process state.
Stores in protected memory area of the kernel.
Consists of the information about the process state
Process ID,
process priority,
parent process (if any),
child process (if any), and
address to the next process PCB which will run,
allocated program memory address blocks in physical memory and in secondary (virtual)
memory for the process-codes,
allocated process-specific data addressblocks
allocated process-heap (data generated during the program run) addresses,
allocated process-stack addresses for the functions called during running of the
process,
allocated addresses of CPU register-save area as a process context represents by CPU
registers, which include the program counter and stack pointer
allocated addresses of CPU register-save area as a process context [Register-contents
(define process context) include the program counter and stack pointer contents]
process-state signal mask [when mask is set to 0 (active) the process is inhibited from
running and when reset to 1, the process is allowed to run],
Context
Context loads into the CPU registers from memory when process starts running, and the
registers save at the addresses of register-save area on the context switch to another process
The present CPU registers, which include program counter and stack pointer are called
context
When context saves on the PCB pointed process-stack and register-save area addresses,
then the running process stops.
Other process context now loads and that process runs This means that the context
has switched.
Thread parameters
Each thread has independent parameters ID, priority, program counter, stack
pointer, CPU registers and its present status.
Thread states starting, running, blocked (sleep) and finished
Threads stack
Task States
(i) Idle state [Not attached or not
registered]
(ii) Ready State [Attached or registered]
(iii) Running state
(iv) Blocked (waiting) state
(v) Delayed for a preset period
Dynamic Page-Allocation
Dynamic Data memory Allocation
Dynamic address-relocation
Multiprocessor Memory Allocation
Memory Protection to OS functions
OSMemPut ( )
to release a memory block or blocks to the partition
Interrupt Service routine
ISR is a function called on an interrupt from an interrupting source.
Further unlike a function, the ISR can have hardware and software assigned
priorities.
Further unlike a function, the ISR can have mask, which inhibits execution on the
event, when mask is set and enables execution when mask reset.
Task
Task defined as an executing computational unit that processes on a CPU and state
of which is under the control of kernel of an operating system.
Context Saving
Structure
Function can change the global variables. The interrupts must be disabled and
after finishing use of global variable the interrupts are enabled.
ISR When using a global variable in it, the interrupts must be disabled and after
finishing use of global variable the interrupts are enabled (analogous to case of a
function).
Task When using a global variable, either the interrupts are disabled and after
finishing use of global variable the interrupts are enabled or use of the semaphores
or lock functions in critical sections, which can use global variables and memory
buffers.
Function can get the parameters and messages through the arguments passed to it
or global variables the references to which are made by it. Function returns the
results of the Operations.
ISR using IPC functions can send (post) the signals, tokens or messages. ISR
cant use the mutex protection of the critical sections by wait for the signals, tokens
or messages.
Task can send (post) the signals and messages.
can wait for the signals and messages using the IPC functions, can use the mutex or
lock protection of the code section by wait for the token or lock at the section
beginning and messages and post the token or unlock at the section end.
i = 1, 2, , N 1 , N