Process Managment Flashcards

1
Q

What is a program?

A

A set of instructions for performing a task

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

What is a process?

A

A program in execution

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

What are the 5 process states?

A

Born, Ready, Waiting, Running, Died

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

What happens when a process is born?

A

A process is created but has not yet been admitted to the pool of executed processes

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

When is a process transferred to the ready state?

A

When the OS is ready for the process, or if another process is required.

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

Why does the processor transfer a process between ready and running?

A

A process is transferred based on a priority its assigned by the processor.

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

When is the waiting stage used?

A

When waiting for input from an I/O device or when the process has made a request it has to wait for.

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

When does a process die?

A

When it has been completed or aborted

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

What is a Process Control Block?

A

the PCB represents a process and is stored in memory or on disk.

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

What data does the Process Control Block Contain?

A

The process number/ID, the processes registers, the process address space, the process I/O.

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

What term is used to describe switching processes?

A

Context Switch or a Process Switch

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

How does a context switch take place?

A

Change Process Scheduling State of process A, save the context of process A (save variables form registers to memory), load context of process B, change Process Scheduling state of process B.

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

What is contained in the process address space?

A

Stack for temp data, heap for dynamically allocated data, data section for static data, text section for program code.

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

How and why is a Heap used?

A

Blocks of memory are allocated and removed in an arbitrary order of any required size. It is used to store a large block of memory for a longer period of time, and variables that can change size.

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

What interaction can happen between the Stack and the Heap?

A

As the stack and the heap grow they grow towards each other in memory, this means that if they aren’t properly controlled they can start to overwrite each other.

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

What is process spawning?

A

When One process is created at the request of another process. These are parent and child processes.

17
Q

How many commands does Linux have for process spawning?

A

4

18
Q

What does the fork command do?

A

Creates a child process with a unique process ID. The child is given a copy of the process address space of the parent.

19
Q

What does the Exec command do?

A

Runs a executable file that overwrites the process address space with a new program.

20
Q

What does the Wait command do?

A

Puts the parent process in the waiting state until the child process has completed.

21
Q

Why is interprocess communication used?

A

Some processes are interested in the same information, this is used when a processes is divided into subtasks.

22
Q

How can interprocess communication be implemented?

A

Shared Memory or Message Passing.

23
Q

How is shared memory implemented?

A

Memory Space from one of the Processes is shared between them. The processes make calls to the kernel to share or to read/write data from the shared space. The processes are responsible they don’t write to the same space simultaneously.

24
Q

How is Message Passing Implemented?

A

Processes communicate by sending messages. Messages are sent and received using a “mailbox” that is not part of the address space of any of the processes. Message passing system must provide send and receive operations.