Chapter 3 (Process Description and Control) Flashcards

1
Q

What are the two states of a process?

A

Running and not running

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

What does the OS do when a new process is created?

A

Builds the data structures needed and allocates space in main memory

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

What are the four primary reasons a process is created?

A

New batch job submitted

Interactive logon occurred

OS creates one for some service

Spawning an existing process

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

T/F The two state model is adequate

A

F

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

What is a problem with the two state model?

A

Requires the dispatcher to search the not-running queue, looking for a process that is not blocked

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

What states are in the five state model?

A
Running
Ready
Blocked
New
Exit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Null -> new

A

Process creation

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

New -> Ready

A

OS is ready for a new process

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

Ready -> Running

A

Based on scheduling algorithm

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

Running -> Exit

A

On termination

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

Running -> Blocked

A

Service call, I/O request

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

Blocked -> Ready

A

Waited event occurs

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

Ready -> Exit

A

Terminated due to parent

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

Blocked -> Exit

A

Terminated due to parent

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

What are the two suspend states?

A

Blocked/Suspend

Ready/Suspend

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

What is the blocked/suspend state?

A

Suspended and awaiting an event

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

What is the ready/suspend state?

A

Suspended and ready to run

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

Blocked -> Blocked/Suspend

A

To free memory

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

Blocked/Suspend -> Ready/Suspend

A

If event occurs while blocked/suspend

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

Ready/Suspend -> Ready

A

If no ready processes, or if suspended process is higher priority than ready queue processes

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

Ready -> Ready/Suspend

A

If need to free up memory and there are no blocked processes, or a ready process if of lower priority than the blocked processes

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

new -> Ready/Suspend and New -> Ready

A

Could add new process to either queue. Might add to the ready/suspend queue if no room in memory or if desired to let OS setup the new process before loading it

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

Blocked/Suspend -> Blocked

A

If suspended blocked process has higher priority than any suspended ready process

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

Running -> Ready/Suspend

A

Rather than returning to the ready queue, could be sent to the ready/suspend to free up memory for some higher priority process

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

Various -> Exit

A

If terminates due to normal completion or error, or by parent, or on some systems if parent terminates

26
Q

T/F The suspend state may be used for other occasions besides swapping a process out of memory

A

T

27
Q

What are the characteristics of a suspended process?

A

Not immediately available for execution

May or may not be waiting on an event

Process was suspended by an agent

Process stays suspended until the agent activates it

28
Q

What are reasons for suspension?

A

Swapping

OS Reason

User request

Timing

Parent request

29
Q

Why swap for suspension?

A

To free main memory

30
Q

What is an OS reason for suspension?

A

OS thinks process is causing a problem (deadlock)

31
Q

What user request would cause a suspension?

A

To debug

32
Q

Why would timing suspend a process?

A

If infrequently run

33
Q

Why would a parent request suspend a process?

A

To examine a child process or its activity

34
Q

What are the 4 categories of information the OS maintains tables of?

A

Memory tables

I/O tables

File tables

Process tables

35
Q

What does the memory table keep track of?

A

Allocation of main memory to processes

Allocation of secondary memory to processes

Protection attributes of blocks of main or virtual memory

Information needed to manage virtual memory

36
Q

What do I/O tables keep track of?

A

Availability of a device

Device assignment to a process

Device status

Operation status

Memory being used for a data transfer

37
Q

What do file tables keep track of?

A

Their location in secondary storage

Their status

Other file attributes

38
Q

What do process tables keep track of?

A

Where the process is located

Attributes of the process

39
Q

Where is the information the OS needs to control a process located?

A

Process Control Block (PCB)

40
Q

All of these together are referred to as the process image

A

User program

User data

System stack

Process Control Block

41
Q

What are the three main parts of the process control block?

A

Process identification

Processor state information

Process control information

42
Q

Process identification has numeric ID’s for…

A

The process

The parent of the process

The user of the process

43
Q

What does the processor state include?

A

User-visible registers

Control and status registers

Stack pointers

44
Q

What things are in the scheduling and state information?

A

Process state

Priority

Scheduling-related information

Event

45
Q

T/F Creating a new process is a relatively short operation

A

F, relatively lengthy

46
Q

When may a process switch occur?

A

Anytime the OS gains control again from the current process

47
Q

What may give the OS control again?

A

Interrupt

A trap

A supervisor call

48
Q

What is a trap?

A

Current instruction creates an error

49
Q

What is a supervisor call?

A

I/O request

50
Q

What are the two kinds of switching?

A

Mode switch

Process switch

51
Q

What is a mode switch?

A

Switch away from process, for example, to run an interrupt handler

52
Q

What is a process switch?

A

Switch from one process to another process

53
Q

What is done for a mode switch?

A

Save context

Set PC to interrupt handler

Switch from user mode to kernel mode

Run interrupt handler

54
Q

What happens upon the return of a mode switch?

A

Switch from kernel mode back to user mode

Set PC to program

Restore context

55
Q

What is done for a process switch?

A

Save context

Update PCB of current process to a non-running state

Move PCB process to appropriate queue for the state

Select another process to run

Update PCB of the selected process in the running staate

Update memory-management data structures

Restore state of newly selected process

56
Q

Does a process switch or mode switch require more work?

A

Process switch

57
Q

What is the nonprocess kernel approach?

A

Executes the kernel outside of any process

58
Q

T/F The idea of a process only applies to user programs in a nonprocess kernel approach

A

T

59
Q

Is a nonprocess kernel approach common on newer or older OS’?

A

Older

60
Q

In a process-based OS, what two kinds of processes does the OS support?

A

User processes

System processes

61
Q

T/F All processes in a process-based OS can then be managed according to priority with some OS functions being low priority and others being high

A

T