Sunteți pe pagina 1din 4

OS Review 2

Process Description

OS Control Structure

• OS keeps tables on behave of processes that include

o Memory table
o I/O, table
o File table
o Process table
o
• OS must understand the general environment of system. This is an issue of
configuration
• Configuration can either be by human assistance or some autoconfiguration
software.

Process Control structure

• OS assembles all elements of associated to a process and keeps them as a


process image.
• Location of process image can either be on disk, virtual or main memory
depending on management scheme
• Paging allows discontinuous physical memory allocation to support partially
resident processes
• Process attribute is info contained in PCB and can be divided into:

o Process identification
o Processor state information
o Process control information

Process Control

• Processor changes modes from user to kernel or and vice versa


• Once the OS has decided to create a process the following take place

o Assign a unique process identifier to the new process. .


o Allocate space for the process.
o Initialize the process control block.
o Create or expand other data structures.

Xtic Process Process image Process control


table block
Content All Program + data + process Process attributes
processes attributes +… (include (include only
locations of program and pointers to program
1
data) and data)
Location OS Hard drive+ virtual + main Main memory
memory
Maintenan OS OS OS
ce
Creation 1st 3rd (created 2nd but without 2nd
timeline PCB)
• An OS can execute a process in 3 different ways, viz:

o Nonprocess Kernel
o Execution within User Processes
o Process-Based Operating System

• These are summarized in the figure below

Chapter 4 Concurrency

• Concurrency deals with managing the simultaneous existence of multiple


processes/threads in a computer system.
• This leads to problem of allocation of resource in an equitable manner
• The OS therefore has to control access to the shared resource.
• A race condition occurs when multiple processes or threads read and write
data items so that the final result depends on the order of execution of
instructions in the multiple processes
• Because of this condition, an OS therefore must be designed to

o keep track of the various processes


2
o allocate and deallocate various resources for each active process
o protect the data and physical resources of each process against
unintended interference
o processing speed of each process must be independent of the speeds
of other processes

• All of the above depend of how processes interact


• Process interaction depends on degree awareness of existence of other
processes
• The table below summarizes process interaction and results

• Competition leads to mutual exclusion. That means that the resource is non-
sharable. It is a critical resource.
• the portion of the program that uses a critical resource is a critical section of
the program
• Mutual exclusion leads to deadlock and starvation
• A deadlock is a situation where two or more processes are blocked by one
another
• Starvation is a situation where a runnable process is able to process but is
never chosen to run.
• Sharing leads to ensuring data integrity.
• Issues of mutual exclusion, deadlock, and starvation are again present.
• Here only writing operations must be mutually exclusive
• Communication between processes means synchronizing, or coordinating
various activities.
• Communication is characterized by as messages passing using OS primitives.
• No mutual exclusion though deadlock and starvation may ensue.

3
• Mutual exclusion can be conducted by either hardware or software. The main
mechanism is to disable interrupt
• Special machine codes are provided to ensure interrupt disabling, by blocking
access to a memory locations from other processes in hardware This include:

o Compare&Swap Instruction
o Exchange Instruction

S-ar putea să vă placă și