Process Management (week 5) Flashcards

1
Q

what is a program

A

a program is a binary program in execution

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

what is a process made up of

A

a binary program

data on which the program will execute

resources required for execution, including the files, devices which contain or provides the data required
–> some examples are CPU time, input-output devices, files, etc

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

multiple processes can be generated from _________

A

1 program file

for example you can only have one browser program but you can have multiple processes running in that program (opening multiple windows)

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

true or false
process also contains memory stack space

A

true

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

how many threads in 1 process are there in the classic process design

A

one as there is only one execution engine per process

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

how many threads in 1 process are there in the modern computer

A

multiple threads as there is multiple execution engines per process

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

threads can be thought of as

A

subprocesses

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

Describe what is a thread

A

a thread is a single execution engine capable of performing a series of instructions in a computer program

In a multiple threaded process, each thread needs to maintain its own set of data in order to perform its own series of instructions.

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

what is an example of threads

A

A word processor may have a thread for
–> displaying graphics,

–> another thread for responding to keystrokes from user

–>third for performing spelling and grammar checking in the background

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

where is thread specific data stored

A

Thread specific data is private to the thread. This data is usually stored in a stack.

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

thread specific data includes:

A

–> Program counter
–> Status of thread
–> processor registers
–> stack space

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

threads within the same process share ?

A

–> Program code
–> Data
–> Resources

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

threads are also called

A

lightweight processes

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

in unix process, OS kernel creates a _____________ to
manage process

A

process descriptor

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

in unix process, what is process identifier

A

it is the User handle for the process (descriptor)

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

what does the linux command ps -aux display

A

list of all the processes running on your system

17
Q

how will the os create a new process in the windows NT model

A

user program makes a system call to request to the kernel to activate the create process function

all this must happen in supervisor mode and not user mode

18
Q

benefits of multithreaded process

A

–> more responsive
–> resource sharing (easier for the os to allocate resources to each process and the process will further allocate to the threads)
–> ease of memory and resource allocation
–> utilization of multiprocessor architectures

19
Q

what is a process manager

A

To manage multiple processes, modern OS
implement the process manager to manage the
processes.

20
Q

what does the process manager implement

A

–> Calls like fork() in UNIX and CreateProcess() in
windows to create processes.

–> Calls like pthread_create() in Linux and
CreateThread() in Windows to support threading.

–> Calls like close() in Unix and CloseHandle() in
Windows to close processes/threads to release
resources.

21
Q

what are the responsibilities of the process manager

A

–> Define & implement the essential characteristics of a
process and thread
–> Algorithms to define the behavior
–> Data structures to preserve the state of the execution
–> Define what “things” threads in the process can
reference – the address space (most of the “things”
are memory locations)
–> Manage the resources used by the processes/threads
–> Tools to create/destroy/manipulate processes & threads —-> Tools to schedule the processes on the CPU.
–> Tools to allow threads to synchronize the operation with one another.
–> Mechanisms to handle deadlock.
–> Mechanisms to handle protection.

22
Q

what information does the process descriptor store

A

–> Process ID
–> Program counter
–> Register values
–> Process state
–> Type & location of resources it holds
–> List of resources it needs
–> Security keys

23
Q

process descriptor is also called

A

process control block (PCB)

24
Q

what is a context

A

In a multiple process environment, each
thread of execution is a context

25
what is a context switch
a context switch happens when the CPU switches between two processes/threads
26
when can the context switch occur
A context switch can only occur when the OS gets control of the CPU through traps or interrupts (happens when os gets access to CPU by switching to supervisor)
27
what is running state
: Instructions are being executed
28
what is Blocked state
The process is waiting for some event to occur (eg, I/O completion)
29
what is Ready state
The process is waiting to be assigned to a processor.
30
what is done state
The process has finished execution
31
true or false Modern OS implements additional states as required to support more complex features.
true