PROCESS MANAGEMENT II Flashcards

1
Q

What are some of the scenarios in which a process would leave the running queue apart from termination

A

-The process could issue an I/O request and then be
placed in an I/O queue.
-The process could create a new sub process and wait for the sub process’s termination.
-The process could be removed forcibly from the CPU, as a result of an interrupt, and be put back in the ready queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Illustrate Process Scheduling

A

*See notes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe process creation

A

A process may create several new processes, via a create- process system call, during the course of execution. The creating process is called a parent process, and the new processes are called the children of that process. Each of these new processes may in turn create other processes,
forming a tree of processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the possibilities, in terms of execution, when a process creates a new process

A

The parent continues to execute concurrently with its
children.
The parent waits until some or all of its children have
terminated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the possibilities, in terms of address space allocation, when a process creates a new process

A

The child is a duplicate of the parent (same program and data)
The child has a new program loaded into it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What typically happens when a process terminates?

A

A process terminates when it finishes executing its final statement and asks the operating system to delete it by using the exit () system call.
At that point, the process may return a status value
(typically an integer) to its parent process (via the wait() system call).
All the resources of the process—including physical and virtual memory, open files, and I/O buffers—are
deallocated by the operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Other than the completion of execution, in what other circumstance can a process terminate?

A

Termination can occur in other circumstances as well. A process can cause the termination of another process via an appropriate system call (for example, TerminateProcess() in Win32).
Usually, such a system call can be invoked only by the parent of the process that is to be terminated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give examples of reasons why a parent may terminate its child process

A

The child has exceeded the usage of some of the resources it has been allocated
The task assigned to the child is no longer required
The parent is exiting and the OS does not allow a child to continue if it terminates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When is a process said to be independent and when is it said to be cooperating

A

A process is independent if it cannot affect or be
affected by the other processes executing in the system. Any process that does not share data with any other process is independent.

A process is cooperating if it can affect or be affected by the other processes executing in the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Give some reasons for providing an environment that allows process cooperation:

A

Information sharing.
Since several users may be interested in the same piece of information (for instance, a shared file), we must provide an environment to allow concurrent access to such information.

Computation speedup.
If we want a particular task to run faster, we must break it into subtasks, each of which will be executing in parallel with the others. Notice that such a speedup can be achieved only if the computer has multiple processing elements (such as CPUs or I/O channels).

Modularity.
We may want to construct the system in a modular
fashion, dividing the system functions into separate
processes or threads.

Convenience.
Even an individual user may work on many tasks at the same time. For instance, a user may be editing,
printing, and compiling in parallel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the two fundamental models of inter-process communication:

A

Shared memory
In the shared-memory model, a region of memory that is shared by cooperating processes is established. Processes can then exchange information by reading and writing data to the shared region.

Message passing.
In the message passing model, communication takes place by means of messages exchanged between the cooperating processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Compare and contrast message passing and shared memory

A

Message passing is useful for exchanging smaller amounts of data, because no conflicts needs to be avoided.

Message passing is also easier to implement than is shared memory for intercomputer communication.

Shared memory allows maximum speed and convenience of communication, as it can be done at memory speeds when within a computer.

Shared memory is faster than message passing, as
message-passing systems are typically implemented using system calls and thus require the more time consuming task of kernel intervention.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the different types of communication between process

A

Direct communication
Indirect communication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe direct communication

A

Each process that wants to communicate must explicitly name the recipient or sender of the communication.
In this scheme, the send() and receive() primitives are defined as:
-send(P, message)—Send a message to process P.
-receive (Q, message)—Receive a message from process Q

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the properties of a communication link in direct communication scheme

A

A link is established automatically between every pair of processes that want to communicate. The processes need to know only each other’s identity to communicate.
A link is associated with exactly two processes.
Between each pair of processes, there exists exactly one link.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the disadvantage of symmetric and asymmetric schemes

A

Limited modularity of the resulting process
definitions. Changing the identifier of a process may necessitate examining all other process definitions.

16
Q

What are the two different types of message passing? Further explain in terms of send and receive

A

Message passing may be either blocking or nonblocking— also known as synchronous and asynchronous.
-Blocking send- The sending process is blocked until the message is received by the receiving process.
-Nonblocking send- The sending process sends the message and resumes operation.
-Blocking receive- The receiver blocks until a message is available.
-Nonblocking receive- The receiver retrieves either a valid message or a null.