Section 1

Preview this deck

What is the mother process on Android?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (22)

Section 1

(22 cards)

What is the mother process on Android?

Front

Android takes an unconventional approach to spawn processes, which ensure application startup is snappy. The process from which all the Android applications are derived is called Zygote. So in the screenshot below, all the applications have PPID of 1914, which is the PID of Zygote.

Back

How does an exec work?

Front

First, it forks as above. Replace child image Load new program and start from the first instruction

Back

What is Context Switching and why is it expensive?

Front

Context switching is where one process is switched into the processor for another. This is expensive because of all of the information that has to be moved about. i.e. the number of instructions that need to be run to load and store all of the information. There are also indirect costs - cold cache - This is where the data in the cache will need to be replaced with data for the new process. cache misses - These occur just after a process change over because of the above.

Back

What is the PCB and what is it used for?

Front

The Process Control Block is a data structure maintained by the operating system and it contains information about every process running on the computer.

Back

What is the equation for useful work?

Front

Useful CPU work = Total processing time/Total time = (2Tp)/(2Tp + 2*t_sched)

Back

How does a PCB update its data?

Front

Certain fields are updated when process state changes. e.g. when more memory is acquired by the process, the virtual memory is updates, as well as things such as memory limits. Some pieces of information are updated very often (e.g. PC) inside the CPU. The OS does not want to update it's own PC for that process every time it changes. Instead, it is the OSs job to update the PC and any other info that changes whenever the process finishes running on the CPU.

Back

What is the basic lifecycle of a process?

Front

The basic lifecycle is as follows: See pic When the process stops running, it is often put into a 'Ready" (idle) state. It can be started up by the Scheduler Dispatch at any time.

Back

What is a process?

Front

Process = state of a program when executing/loaded into memory (active entity) Multiple processes could be running from a single application/program. They will more than likely have different states.

Back

What does a process consist of?

Front

Every element of the process state has to be uniquely identified by its address. An OS abstraction used to encapsulate all of the process state is an address space. Types of state: Text (code) and data Static state when process first loads Heap Dynamically created during execution Stack LIFO - grows and shrinks

Back

How does a fork work?

Front

A fork creates a copy of itself. Copies the parent PCB into the new child PCB. The child continues execution after the fork.

Back

In a CPU, what does preempt mean?

Front

interrupt and save current context

Back

What is a CPU scheduler?

Front

A CPU scheduler dets which one of the currently ready processes will be dispatched to the CPU to start running and how long it should be run for.

Back

What states can a process be in and how does it change between those states?

Front

When a process is created, it will enter the NEW state. This is where it will perform: - Admission control, and - Allocate and initiate a process control block and initial resources Provided the resources are available, the process will be admitted and it will be READY to start executing. It will wait in this ready state until the schedule is ready. Then it will be put into the RUNNING state. From the running state, a number of things can happen: It can be interrupted to be context switched. It will then be moved into the READY state again. It may go to initiate some longer operation, such as reading data from disk (I/O or event completion). Here it will go into a WAITING state. If it finishes the program or encounters an error, it can go into the TERMINATED state.

Back

What is a page table?

Front

page tables = Mapping of virtual to physical addresses. Parts of these address spaces will be swapped on and off the disk as needed. The page table may map to physical locations in RAM or on disk. This page table will also be used to check which parts of memory a process is legally allowed to use.

Back

What 3 things need to be efficient in a scheduler?

Front

This should be very efficient. Efficient code, algorithms and data structures.

Back

What things are contained in a PCB for each process? PPP RML PSC

Front

Back

What does an OS manage?

Front

OS manages hardware on behalf of applications Applications = program on disk, flash memory etc (static entity i.e. it is not executing)

Back

What is the mother process on Unix based systems?

Front

Init process is the mother (parent) of all processes on the system, it's the first program that is executed when the Linux system boots up; it manages all other processes on the system. It is started by the kernel itself, so in principle it does not have a parent process

Back

What is a timeslice

Front

Timeslice == Time Tp allocated to a process on the CPU

Back

What is a process and give two other names for them.

Front

A process is an instance of an executing program. Synonymous with "task" or "job".

Back

What are the 3 steps for a scheduler to swap processes?

Front

1. Preempt: The OS must be able to preempt (interrupt and save current context). 2. Schedule: It should then run the scheduler to choose the next process. 3. Dispatch: Finally, it should dispatch the process and switch to its context.

Back

What is an address space?

Front

It is an "in memory" representation of a process.

Back