-15-
damage or alteration. In kernel mode, the operating system does not have these
restrictions, so that it can perform its tasks.
3.11 1. Assign a unique process identifier to the new process. 2. Allocate space for the
process. 3. Initialize the process control block. 4. Set the appropriate linkages. 5.
Create or expand other data structures.
3.12 An interrupt is due to some sort of event that is external to and independent of the
currently running process, such as the completion of an I/O operation. A trap
relates to an error or exception condition generated within the currently running
process, such as an illegal file access attempt.
3.13 Clock interrupt, I/O interrupt, memory fault.
3.14 A mode switch may occur without changing the state of the process that is
currently in the Running state. A process switch involves taking the currently
executing process out of the Running state in favor of another process. The process
switch involves saving more state information.
A
A
NSWERS TO
NSWERS TO
P
P
ROBLEMS
ROBLEMS
3.1 •Creation and deletion of both user and system processes. The processes in the
system can execute concurrently for information sharing, computation speedup,
modularity, and convenience. Concurrent execution requires a mechanism for
process creation and deletion. The required resources are given to the process
when it is created, or allocated to it while it is running. When the process
terminates, the OS needs to reclaim any reusable resources.
•Suspension and resumption of processes. In process scheduling, the OS needs to
change the process's state to waiting or ready state when it is waiting for some
resources. When the required resources are available, OS needs to change its
state to running state to resume its execution.
•Provision of mechanism for process synchronization. Cooperating processes
may share data. Concurrent access to shared data may result in data
inconsistency. OS has to provide mechanisms for processes synchronization to
ensure the orderly execution of cooperating processes, so that data consistency is
maintained.
•Provision of mechanism for process communication. The processes executing
under the OS may be either independent processes or cooperating processes.
Cooperating processes must have the means to communicate with each other.
•Provision of mechanisms for deadlock handling. In a multiprogramming
environment, several processes may compete for a finite number of resources. If
a deadlock occurs, all waiting processes will never change their waiting state to
running state again, resources are wasted and jobs will never be completed.
3.2 The following example is used in [PINK89] to clarify their definition of block and
suspend:
Suppose a process has been executing for a while and needs an additional
magnetic tape drive so that it can write out a temporary file. Before it can
initiate a write to tape, it must be given permission to use one of the drives.
When it makes its request, a tape drive may not be available, and if that is the