Chapter 3: processes Flashcards

1
Q

What is a process

A

a program in execution; process execution must progress in sequential fashion

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

the 5 sections of process:

A

The program code, also called text section
Current activity including program counter, processor registers
Stack containing temporary data
Function parameters, return addresses, local variables
Data section containing global variables
Heap containing memory dynamically allocated during run time

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

Program vs Process

A

Program is passive entity stored on disk (executable file), process is active

Program becomes process when executable file loaded into memory

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

5 states of a process

A

new: The 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 execution

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

What is a process control block?

A

Information associated with each process
(also called task control block)
Process state – running, waiting, etc
Program counter – location of instruction to next execute
CPU registers – contents of all process-centric registers
CPU scheduling information- priorities, scheduling queue pointers
Memory-management information – memory allocated to the process
Accounting information – CPU used, clock time elapsed since start, time limits
I/O status information – I/O devices allocated to process, list of open files

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

What is the process scheduler?

A

Maintains scheduling queues of processes
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 processes waiting for an I/O device
Processes migrate among the various queues

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

What is a context switch

A

When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch
Context of a process represented in the PCB

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

process termination (zombie vs orphjan)

A

The parent process may wait for termination of a child process by using the wait()system call. The call returns status information and the pid of the terminated process
pid = wait(&status);
If no parent waiting (did not invoke wait()) process is a zombie
If parent terminated without invoking wait , process is an orphan

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

What are the two models of interprocess communication

A

Share memory
Message passing

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

What are the advantages of process cooperation

A

Advantages of process cooperation
Information sharing
Computation speed-up
Modularity
Convenience

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

Producer consumer problem, and buffer

A

Paradigm for cooperating processes, producer process produces information that is consumed by a consumer process
unbounded-buffer places no practical limit on the size of the buffer
bounded-buffer assumes that there is a fixed buffer size

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

Types of communication links between processes

A

Physical:
Shared memory
Hardware bus
Network
Logical:
Direct or indirect
Synchronous or asynchronous
Automatic or explicit buffering

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

Direct vs indrect communication:

A

Send a message to process P vs send to a mailbox.`

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