Chapter 3: Processes Flashcards

1
Q

What is a process?

A

The unit of work in a modern time-sharing system

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

List and define the 5 states

A

New - The process is being created.
Running - Instructions are being executed.
Waiting - The process is waiting for some event to occur (such as an I/O completion or reception of a signal).
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
3
Q

What state(s) can a process transition to from running?

A

waiting
blocked/ready
blocked/suspended
terminated

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

When a process is swapped out or suspended in secondary memory, what state does it have to transition to in order to be scheduled?

A

Ready/suspended

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

What three state(s) can process transition to ready?

A

suspended
waiting
running

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

In the UNIX state diagram, there is a user running state and a kernel running state. Why is this?

A

for dual mode, processes to run simultaneously.

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

What scheduler determines which process will be run by the CPU?

A

Short term scheduler

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

Describe long and short term scheduling

A

Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue. Is invoked very infrequently and can be slow. (seconds, minutes) Controls the degree of multiprogramming.

Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU.
Is invoked very frequently (milliseconds). Has to be fast.

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

What’s the difference between I/O and CPU bound processes?

A

I/O spends more time doing I/O than computations. Has many short CPU bursts.

CPU spends more time doing computations. Has few very long CPU bursts.

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

What happens to processes that are running and then request an I/O?

A

The processes are placed in an I/O queue.

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

Why are processes put in a swapped/ready state?

A

Because theres too much contention so it must wait.

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

What are some possible reasons that cause a process to give up the CPU or become blocked and eventually be moved to the ready queue?

A

Interrupts

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

What’s the importance of degree of multiprogramming?

A

It has make a careful selection and select a good process mix. I/O and CPU bound processes .

If all processes are I/O bound, the ready queue will almost always be empty, and the short-term scheduler will have little to do.

If all processes are CPU bound, the I/O waiting queue will almost always be empty, devices will go unused, and again the system will be unbalanced.

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

What operating systems don’t have long-term schedulers?

A

Unix and microsoft windows

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

What’s the idea behind medium-term scheduler?

A

To remove processes from memory and reduce the degree of multiprogramming and to possible add processes back into memory later using the swapping method. The key advantage of doing this is to improve the process mix or to free up memory.

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

Describe Context Switching

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.

Context-switch time is overhead; the system does no useful work while switching.

Time dependent on hardware support.

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

What resources does a child need to complete a task?

A

CPU time, memory, files, I/O devices

18
Q

Give a characteristic of Independent and Cooperating processes

A

Independent process cannot affect or be affected by the execution of another process.

Cooperating process can affect or be affected by the execution of another process.

19
Q

What are the advantages of Cooperating processes?

A

Information sharing
Computation speed-up
Modularity
Convenience

20
Q

List and Define the two Interprocess Communication models

A

Message system – processes communicate with each other without resorting to shared variables.

Shared Memory- a region of memory is shared by co-operating processes.

21
Q

How’s information exchanged through shared memory communication?

A

Through reading and writing to shared region.

22
Q

How’s information exchanged through message system communication?

A

Through messages.

23
Q

What are some characteristics of shared memory and message system communication?

A

Shared memory communication: Faster than message system communication.

Message system: Easier to implement, useful for exchanging small amounts of data, and Implemented using system calls and thus requires intervention of kernel.

24
Q

What’s the difference between an unbounded buffer and a bounded buffer?

A

Unbounded: places no practical limit on the size of the buffer.

Bounded: assumes that there is a fixed buffer size.

25
Q

Give a characteristic and name some properties of communication links in Direct Communication

A

Characteristic: Processes must name each other explicitly.

Properties of communication links:
Links are established automatically.

A link is associated with exactly one pair of communicating processes.

Between each pair there exists exactly one link

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

Symmetric vs. Asymmetric

26
Q

Give a characteristic and name some properties of communication links in Indirect Communication

A

Characteristics: Messages are directed and received from mailboxes (also referred to as ports)

Each mailbox has a unique id.

Processes can communicate only if they share a mailbox.

Properties of communication link:
Link established only if processes share a common mailbox.

A link may be associated with many processes.

Each pair of processes may share several communication links.

Link may be unidirectional or bi-directional.

27
Q

List the operations of Indirect Communication

A

reate a new mailbox
send and receive messages through mailbox
destroy a mailbox

28
Q

What are some reasons a parent may terminate the execution of a child?

A

Child has exceeded allocated resources.
Task assigned to child is no longer required.

All children terminated - cascading termination

29
Q

What happens when a process is terminated?

A

Process executes last statement and asks the operating system to delete it (exit)

Output data from child to parent (via wait)

Process’ resources are deallocated by operating system

30
Q

Describe process creation

A

Parent process create children processes, which, in turn create other processes, forming a tree of processes.

31
Q

Give characteristics of resource sharing, execution, and address in process creation.

A

Resource sharing:
Parent and children share all resources
Children share subset of parent’s resources
Parent and child share no resources

Execution:
Parent and children execute concurrently
Parent waits until children terminate

Address Space: Child duplicate of parent
Child has a program loaded into it

32
Q

Give some unix examples of process creation

A

fork system call creates new process

exec system call used after a fork to replace the process’ memory space with a new program

33
Q

What are the two characteristics of execution that happen when a process creates a process?

A

The parent continues to execute concurrently with it’s children.

The parent waits until some or all of its children have terminated.

34
Q

How are message passing systems implemented?

A

They are implementing with the use of system calls

35
Q

Why is shared memory faster than message passing?

A

because message-passing systems are typically implemented using system calls and require the more time-consuming task of kernel intervention

36
Q

What are some issues of shared memory?

A

cache coherency

37
Q

What’s the difference between symmetry and asymmetry in direct communication?

A

Symmetry: both the sender process and the receiver process must name the other to communicate.

Asymmetry:only the sender names the recipient; the recipient is not required to name the sender.

38
Q

What’s the disadvantage of symmetry and asymmetry schemes?

A

limited modularity of the resulting process definitions.

Changing the identifier of a process may necessitate examining all other process definitions.

39
Q

What an advantage of the multiprocess approach?

A

Websites run in isolation from one another. If one website crashes, only its renderer process is affected; all other processes remain unharmed.

40
Q

Define Sandbox in multiprocess

A

Access to disk and network I/O is restricted, minimizing the effects of any security exploits.

41
Q

What is the purpose of remote procedure call?

A

calls information that is to be received.

42
Q

What does the semantics of at most once mean in terms of remote procedure calls?

A

Only receives the first set of information set and none of the rest. This is to avoid duplicates and possible loss/corruption of data.