Chapter 3: Processes Flashcards

1
Q

Describe the 5 States of a Process.

A

New: Process is being created
Running: Instructions are being executed
Waiting: The process is waiting for some event to occur
Ready: The process is waiting to be assigned to a processor
Terminated: The process has finished termination

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

What is the Process Control Block(PCB)?

AKA Task Control Block

A

Information associated with each process.
For example, state, program counter, CPU registers, CPU scheduling information, Memory-management information, I/O status Information

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

How does Process Scheduling Work?

State and describe the 3 scheduling queues.

A

Maximizes CPU use by quickly switching processes onto CPU for time sharing. It selects among available processes for next execution on CPU.

Job queue: Set of all processes in the system
Ready queue: Set of all processes residing in main memory, ready and waiting to execute.
Device queues: Set of all processes waiting for an I/O device

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

What types of Schedulers are there?

Describe them.

A

Long-Term Scheduler(Job scheduler) - selects which schedulers should be brought into the ready queue. Controls degree of multiprogramming. Strives for good process mix.
Short-term Scheduler(CPU scheduler) - selects which process should be executed next and allocates CPU
Medium-term Scheduler - added if degree of multiple programming needs to decrease. remove process from memory, store on disk, bring back to continue, SWAPPING!

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

What is Context Switching?

A

Saves the state of the old process and loads the state of the new process.

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

Describe the process of creating a process.

How is it identified?

A

Parent process create children processes, which, in turn create other processes, forming a tree of processes.
Process identified and managed via a process identifier(pid)

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

How are processes terminated and for what reasons?

A

Executes last statement.
Parent terminates child execution because child exceeded allocated resources, task assigned to child no longer required, or parent is exiting.
Waiting for termination, returning pid.
No parent waiting, terminated process a zombie.
Parent terminated, processes are orphans.

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

Why do Cooperating processes need interprocess communication(IPC)? What are the to models of OPC?

Name 4 advantages of process cooperation.

A

A cooperating process can be affected by other processes, including sharing data.
Two models are shared memory and message passing.

Information sharing
computation speed-up
Modularity
convenience

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

What’s Message Passing?

A

A mechanism for processes to communicate and to sychronize their actions. They need to establish a communication link.

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

Implementation Questions for Direct communication.
How are links established?
Can a link be associated with more than 2 processes?
How many links can there be between every pair of communicating processes
What is the capacity of a link?
Is the size of a message that the link can accommodate fixed or variable?
Is a link undirectional or bi-directional?

A

Processes name eachother explicitly. Ex. (P, message) - send a message to process P
Established automatically
A link is associated with exactly one pair of communicating processes
Between each pair there is exactly one link

The link may be undirectional, but is usually bi-directional.

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

Implementaion Questions for Indirect communication.
How are links established?
Can a link be associated with more than 2 processes?
How many links can there be between every pair of communicating processes
What is the capacity of a link?
Is the size of a message that the link can accommodate fixed or variable?
Is a link undirectional or bi-directional?

A

Messages directed and received from mailboxes.
Process can communicate only if they share a mailbox
Link established only if processes share a common mailbox
A link may be associated with may processes
Each pair of processes may share several communication links
may be unidirectional or bi-directional
mailbox sharing

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

How does synchronization work?

Which is synchronous and non-synchronous?

A

Message passing by blocking or non-blocking.
Blocking is synchronous
Non-block is asynchronous

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

What’s buffering?

What are the 3 implementations?

A

A queue of messages attached to the link

  1. Zero capacity sender waits for receiver
  2. Bounded capacity finite length of n messages sender must wait if link full
  3. Unbounded capacity - infinite length sender never waits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define a Socket.

A

Endpoint for communication.
Concatenation of IP address and port
communication consists between pair of sockets

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

What are Pipes?

Name the 2 and describe them.

A

Act as conduit allowing two processes to communicate
Named pipes and ordinary pipes.
Named pipes are more powerful, communication id bidirectional, no parent-child relation necessary, several processes can us.
Ordincary pipes allow communication in standard producer-consumer style, producer write to one end, undirectional, require parent-child relation for process communication.

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