Arch & ops Flashcards

1
Q

Define computer architecture and give an example

A

Those attributes that have a direct impact in the logical execution of a program
* E.g. the design of a house - computer models

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

Define Computer Organisation and give an example

A

Refer to operational units and their interconnections that realise the architectural operation
* E.g. Building a house with bricks & technology

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

Define computer structure

A

Computer structure is the way in which the components of the computer work together

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

Define computer function

A

Computer function is the operation of each individual component as part of the structure

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

What are the 4 main functions of the computer

A

. Data processing
. Data storage
. Data movement
. Control

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

What are the 2 types of data storage?

A

Long term and short term

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

What does data movement involve ?

A
  • Input/Output
    • Peripheral
    • Data communication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does data processing refer to?

A

Data processing refers to storage control and processing

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

What does data control refer to?

A

Data control refers to control processing and storage

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

What does computer structure consist of ?

A

○ Central Processing Unit(CPU)
○ Main Memory
○ I/O
○ System Interconnection(Buses)

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

What is the CPU ?

A

The cpu is a top level component that is basically the brain of the computer

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

What does the CPU consist of ?

A

○ Control Unit - Controls the operation of the CPU and hence the computer
○ Arithmetic & Logic Unit(ALU) - Performs the computer’s data processing functions it does this by making use of binary numbers and gates
○ Registers - Provides storage internal to the CPU(better definition in session 13)
○ CPU interconnections - Some mechanism that provides for communication among the control unit, ALU, and registers.

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

What does the control unit consist of ?

A

○ Sequencing logic
○ Control Unit Registers and decoders
○ Control Memory

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

What does ISA stand for?

A

ISA stands for Instruction Set Architecture

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

What is ISA ?

A
  • It’s a stored program concept meaning when you write a program it is stored in memory
    • Data & instructions(sometimes referred to as programs) stored in main memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Does the ALU use binary numbers and make use of gates ?

A

Yes

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

What are the 2 types of ‘words’ in computer architecture ?

A

Number words & instruction words

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

What are number words?

A

Number words is for storing data. Basically stores binary numbers

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

What are instruction words ?

A
  • Instruction word is split into left & right
    The left or right is split further into opcode and address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the difference between opcode and operand?

A
  • Opcode is operations that correspond to numbers
    . Operand is the thing affected by the opcode.

.E.g. MULTIPLY 101 opcode is Multiply and the operand is 101

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

Give some info on instruction and number words

A
  • Instruction and number words are addressable they have 1000 locations and you refer to addresses to fetch the data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Why are there 2 different types of words ?

A

To save space

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

What are registers ?

A

Registers are fast small and expensive memory. They are used by the processor to store small amounts of data that are needed during processing, such as: the address of the next instruction to be executed.

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

What does MBR stand for?

A

Memory buffer register

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

What does the MBR do and where is it located ?

A

MBR stores words in memory. It sends and receives these words stored in memory to the I/O Unit. It is located in the ALU

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

What does MAR stand for and what does it do ?

A

Memory Address Register.
* The MAR specifies(shows) the address in memory of the word to be written from or read into the MBR.

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

What does IR stand for and what does it do?

A

Instruction Register(IR) - Contains the 8-bit opcode instruction being executed. It Decodes the instructions and sends signal to the ALU

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

What does IBR stand for and what does it do?

A

IBR (Instruction buffer register). It temporarily holds the right hand instruction from a word in memory.

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

What does PC stand for and what does it do ?

A

Program counter(PC) - Points to the next address to be executed

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

What does the Accumulator do?

A

Holds the results of arithmetic & logistic calculations

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

What does MQ stand for and what does it do ?

A

The MQ(Multiplier Quotient) deals with multiplication

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

What does I/O AR stand for?

A

input output address register

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

What does I/O BR stand for ?

A

input output buffer register

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

What happens during the fetch cycle?

A

We read the instruction from memory

○ During the fetch cycle, the opcode of the next instruction is loaded into the IR and the address portion is loaded into the MAR. This instruction may be taken from the IBR, or it can be obtained from memory by loading a word into the MBR, and then down to the IBR, IR, and MAR.

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

What happens during the execute cycle ?

A

The execute cycle is where we execute this part starts after the IR.

○ Once the opcode is in the IR, the execute cycle is performed. Control circuitry interprets the opcode and executes the instruction by sending out the appropriate control signals to cause data to be moved or an operation to be performed by the ALU.

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

What is Instruction set

A

Basically LMC make sure you practice

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

What are the 3 concepts in ISA ?

A
  • Single read-write memory
    • Addressable Memory
    • Execution occurs in a sequential fashion from one instruction to the next unless modified. A good example of this modification is interrupts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is the difference between hardwired and software ?

A
  • Hardwire is a function or device that is physically built into the computer instead of programmed into the software. Hardwired functions cannot be removed from the computer and usually allow hardware to control the operation instead of software.

In software the Instruction codes are sent to the instruction Interpreter(II). It then sends a control signal to the ALU and retrieves the data.

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

Look at fetch execute question from week 14

A

Do IT NOW

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

What comes under interconnection structure ?

A
  • Computer as a network of basic modules
    • Paths for connecting the modules
    • Structure depends on the exchanges
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What type of transfers must interconnection support ?

A

Memory to Processor:The processor reads an instruction or a unit of data from memory.

Processor to Memory:The processor writes a unit of data to memory

I/O to Processor: The processor reads data from an I/O device via an I/O module.

Processor to I/O: The processor sends data to the I/O device.

I/O to or from Memory: I/O module is allowed to ex- change data directly with memory, without going through the processor, using direct memory access.

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

What comes under Computer Communication?

A
  • Find the address
    • Data communication is needed
    • Reading and writing signals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What comes under Input/Output devices ?

A
  • Read/write
    • Control more than one external device (port - unique address)
    • External data path(input/output) with an external device
    • Interrupt signals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What comes under Processor?

A
  • Reading instruction and data
    • Write out data after processing
    • Use control signals to control the overall operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What are the types of interconnection?

A

. Bus interconnection
. point to point interconnection

46
Q

Give some info on bus interconnection

A
  • Bus interconnection is a communication pathway connecting 2 or more devices
  • Key characterisitic is the shared transmission media. This means everyone(data,memory etc)
    can use it
  • Multiple devices connect to the buses,and a signal transmitted by any one device is available for reception by all other devices attached to the bus
  • A disadvantage is that bus has signal overlap and can become garble meaning only 1 device at a time cam successful transmit
  • A bus consist of multiple communication pathways, lines - each transmit representing binary numbers 0 or 2
47
Q

Give some info on point to point interconnection

A
  • To solve the problem of bus interconnection we use point to point interconnection
  • Contemporary Systems are becoming more reliant on Point to point
  • Point to point is better because it doesn’t require permission like buses
  • Lower latency, higher data rate, better scalability
  • QuickPath Interconnect (QPI - 2008)
    ○ Multiple Direct Connections
    ○ Layered Protocol Architecture
    ○ Packetized Data Transfer
48
Q

Give some info on bus operation?

A
  • If one module wishes to send data to another:
    ○ Obtain the use of the bus
    ○ Transfer the data via the bus
  • If one module wishes to request data from another module
    ○ Obtain the use of the bus
    ○ Transfer a request to other module over the appropriate control and address lines
49
Q

Give some info on address lines

A
  • Address lines: to designate the source or destination of the data on the data bus
  • It is responsible for the following:
  • Source/destination of the data on data bus - Address Bus
  • Bus width - Determines the maximum possible memory capacity
  • Address I/O ports
  • Higher order bits - select module
  • Lower order bits - memory location or I/O port
  • e.g. : 01111111 - memory (0), 128 words
  • e.g. : 10000000 - I/O (1), ports
50
Q

Give some info on control lines

A
  • Control lines: to control the access to and the use of the data and address lines
  • It is responsible for the following:
  • Control the access and the use of the data and address bus (WHY?)
  • Control signals:
    . . . Command signals: Specify operation to be performed
    . Timing Signals: Validity of data and address information
  • Control lines include: Memory write & read, I/O write & read, …
51
Q

Define memory?

A

memory stores info temporarily or permanently and provides the CPU with its instructions

52
Q

Name some different types of memory

A
  • RAM,ROM ,CD,Hardrive,USB, Optical
53
Q

Give some key characteristics of memory

A

Location - Memory can be internal(processor registers, main memory, cache) or external(optical disks, magnet disks tapes)
Capacity:
Number of words
Number of bytes
* Unit of transfer - Bits, words(instruction) or blocks of data can be transferred
* Physical Type(should know from GCSE:
Semiconductor
Magnetic
Optical
Magneto-optical(combination of the 2 above)
* Physical characteristics:
Volatile/nonvolatile Volatile when there’s no power everything is lost. Non-volatile is when there is no power data is not lost but stays
Erasable/non-erasble - ROM is nonerasable because its read only. RAM is erasable
* Performance:
Access time(latency). Sequential access has the most access time. The other methods are quicker.
Cycle time - The time it takes to use the buses + access time. Or access time + transfer time
. Access methods
. Cost

54
Q

What are the different types of access methods?

A

. Sequential access(linear sequence). This is where it starts from the beginning and goes in order until the end
. Direct access - Disk units this is where we don’t start from the beginning but we go directly to an address provided
. Random access(Main memory, Cache systems) - It randomly brings a block of addresses or words
. Associative access - It brings some data that are of similar form together. This helps increase speed.

55
Q

What are the relationships in memory ?

A

◊ Greater Capacity = Lower Cost per unit
◊ Greater Capacity = Slower Access time
◊ Faster Access time = Greater Cost

56
Q

Give some info on cache memory ?

A
  • Cache memory combines fast and expensive memory with less expensive and lower speed
    • Cache memory reads blocks of data instead of reading word by word
    • Cache contains a copy of portions of memory
57
Q

What is the operating system?

A

The operating system is itself a program, which is written, compiled, tested and debugged just like any other program. This program is run whenever a computer is switched on. It is almost always done automatically – no special command is required – so users may not be aware that it happens every time they switch on a machine. It stays running all the time until the machine is switched off.
* In simpler terms the operating system is software which makes the hardware more useful and more user-friendly.

58
Q

Give some reasons why we need an operating system ?

A
  • Provides an environment which helps other parts of the computer to work productively
  • Helps a user to develop and run programs, by providing a convenient environment
  • Starting and stopping programs, and sharing the CPU between them
    Memory management
  • Input and output
  • File system/organisation specifying an address to hold a certain file
    • Protection. E.g. one memory,one CPU : protects against programs interference
    • Networking. E.g covers up the difference between machines.
    • Error handling
      Process management
59
Q

Are windows GUI and linux interpreter the same ?

A

No

60
Q

What is a kernel?

A
  • Kernel is the central component(the brain) of the operating system
  • Makes the software to interact with the hardware to get a specific task done.
  • It decides the amount of resources (RAM, GPU,… ) to be used by every application.
  • It decides on what programs to be executed and on what order.
61
Q

Give some special things kernel has?

A
  • It has separate space on memory so it functions independently. That’s why sometimes although you have nothiing on your machine memory is being used
  • It acts as a central authority which guides memory and keeps eye on all the hardware and software data flow.
  • System call: Every process which starts on a system, demands the resources from kernel.
62
Q

Name the 2 modes the CPU operates in

A

. User mode
. Kernel mode

63
Q

What is User mode?

A
  • User Mode - the CPU can only execute a subset of its instructions – the more common ones, like add, subtract, load and store, etc. If a program is executed in user mode, it does not have access to memory, hardware and such resources it has to go through the kernel
    • User mode is for the application
64
Q

What is kernel mode?

A
  • Kernel Mode - the CPU can execute all of its instructions, including extra privileged instructions.If a program is executed in Kernel mode, it has direct access to memory, hardware and such resources
65
Q

What are the 2 types of kernel?

A

.Monolithic
. Micro

66
Q

Give some info on monolithic kernel

A

. user services and kernel services both are kept in the same address space (entire OS is in kernel space)
. Larger than micro kernel
. less access time and fast execution
. hard to extend
. higher performance
. higher risk of system crash

67
Q

Give some info on Micro kernel

A

. user services and kernel services are kept in separate address space
. smaller in size
. greater access time and slow execution
. easily extendable
. lower responsibility

68
Q

What OS uses monolithic or micro

A

Linux uses monolithic kernel so it uses kernel mode and is more efficient

Windows uses both monolithic and micro so its user mode is less efficient and less popular than linux

69
Q

Name some types of operating systems and give some info on them

A

. Batch OS:
- Limits the user as they have little access to things
- Earliest systems developed
- Data and the commands to manipulate the program and data are all submitted together to the computer in the form of a ‘job’.
- Little or no interaction between users and an executing program.

. Interactive Operating system:
- Most common mode of computing using keyboard, mouse and screen.
- Significant improvement on batch systems
- Has single user basis (Windows, MS-DOS and OS/2) and Multi user basis( Unix, Linux, Windows 10, Ubuntu, Mac OS)

. General purpose OS:
- A host operating system that can be used to run many kinds of applications

. Network OS :
- To share resources such as printers and databases across a network, such as Windows Server.

. Distributive OS:
- Most recent
- consists of a group of machines acting together as one. When user starts program, it may actually run on the local machine. But if computer is heavily loaded, and the operating system knows that another machine is idle, then the job may be transferred to that idle machine.

Specialist OS :
Dedicated to processing large volumes of data, which are maintained in an organized way such as real-time operating system, banking system

70
Q

What is a process?

A

A process is the unit of work in a computer system aka a sequence of steps

71
Q

What structure does the OS maintain for it to work?

A

It maintains a structure known as a Process control block for each process.

72
Q

What does the process control block contain?

A

. Process state -the state of the thread RUN/WAIT
. process number
.program counter
. registers
. memory limits
. list of open files

73
Q

How does the process control block enable the OS to work efficiently ?

A

Saves the current state in the process control block, switching between them and reloading certain processes later on

74
Q

What are the 2 aspects of any process?

A

. Static Part
. Dynamic Part

75
Q

What is the static part and what does it include ?

A

Task - resources allocated to the process, includes:
- Certain amount of memory
- A working directory
- Sources of input and output such as a keyboard, screen and open files
- A connection with another process over a network
A program (sequence of instructions - inert)

76
Q

What is the dynamic part and what does it include?

A

Its a program in action it includes :
* Instructions that make up a program are actually being carried out
* It is known as a ‘thread of execution’, or a ‘thread of control’, or a ‘thread’
* A thread has access to all of the resources assigned to the task

77
Q

Give some info on processors

A

A processor is the agent which runs a process by executing the instructions contained in its associated programs
* There are far fewer processors than processes. So, processes get their share of time on the processor.
* A process is never offered the processor while it is waiting (for keyboard input, for example).

. Look at slide example could come up(session 19 in notes)

78
Q

What is Operating System Overhead ?

A
  • It happens frequently that a process begins running on a processor and almost immediately stops again to wait for some input to become available.
  • The operating system has to save or restore the whole state of the machine as it was at the moment when the process stopped running or begins running again.
  • Saving and restoring state is overhead and non-productive work, and here it is becoming a large part of the overall work of the computer(excess usage).
  • This causes Increased size of operations, operating systems become more complex, requiring more state to be remembered.
79
Q

What is a solution to overhead?

A

Multi threading

80
Q

What is multi threading?

A

Multithreading is having a number of paths of execution(multiple threads) through the program at the same time. If one thread is blocked another can execute

81
Q

Look at one threading and multi threading image in session 19 of notes

A

DO IT MAN

82
Q

What are the 2 types of threads ?

A

. User threads
. Kernel threads

83
Q

What are user threads?

A

They are above the kernel and without kernel support. These are the threads that application programmers use in their programs. This saves on the overhead each time control changes from one thread to another. The operating system gives control of the CPU to a process.

84
Q

What are kernel threads ?

A

They are supported within the kernel of the OS itself. OS handles all the switching between threads. All modern OSs support kernel level threads, allowing the kernel to perform multiple simultaneous tasks and/or to service multiple kernel system calls simultaneously

85
Q

What does the process include?

A

. Task - the resources allocated
.One or more Threads or control paths

86
Q

What are the 2 different states of a thread ?

A

. Run - ready and able to do some work. There would be many threads in this state, linked together on a run queue.

. Wait - for some reason or other it is unable to use the CPU. A thread in this state is waiting for some event (physical resource e.g. printer) and threads in this state are linked together on a wait queue

87
Q

What are the 3 reasons why a thread may stop using the CPU?

A

○ Voluntarily: Waiting for a resource - WAIT state
○ Termination: terminating a thread or whole process
○ Preemption: OS takes the processor from a thread. when a thread has used up its share of time, or when the CPU is needed to handle some more urgent work(interrupts)

88
Q

When does a thread leave the WAIT state?

A

When the event it is waiting for occurs

89
Q

What is context switching?

A
  • Context switching is called when:
    ○ A thread loses control of the processor and moves into the WAIT state to wait for a resource to become available
    ○ A timer interrupts to tell it that it has used up its time slice
90
Q

What are the stepsin the CPU I/O cycle?

A

A cycle of CPU execution and Input I/O wait.

  • Processes alternate between these two states. Process execution begins with a CPU burst. That is followed by an I/O burst, which is followed by another CPU burst, then another I/O burst, and so on.
  • The final CPU burst ends with a system request to terminate execution.
  • In order to maximize efficieny whilst a process is in a wait state another process should be executed or else it will take longer for a process to run.(multi threading)
91
Q

What does the scheduler do?

A
  • The scheduler selects a process from the processes in memory that are ready to execute and allocates the CPU to that process.

Conceptually, all the processes in the ready queue are lined up waiting for a chance to run on the CPU

92
Q

What is non preemptive scheduling ?

A
  • Non pre-emptive means the process cannot be stopped or interrupted by any other processes.

There is no choice (priority) in terms of scheduling

  • CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state.
  • This method was used in windows 3
93
Q

Under what circumstances does non preemptive scheduling occur?

A

. When a process switches from the running state to the waiting state (for example, as the result of an I/O request).

. When a process terminates.

94
Q

What is another name for non preemptive scheduling?

A

cooperative scheduling

95
Q

What is preemptive scheduling ?

A

The process can be stopped or interrupted by another process with higher priority

  • There are Choices in terms of scheduling.
  • It requires the special hardware (for example, a timer) needed for preemptive scheduling
  • This process is more complex and efficient
  • This method was used in windows 95
  • MAC OS also uses this
96
Q

Under what circumstances does preemptive scheduling occur?

A

○ When a process switches from the running state to the ready state (for example, when an interrupt occurs).

○ When a process switches from the waiting state to the ready state (for example, at completion of I/O)

97
Q

What are the 3 types of schedulers?

A

. Long term scheduler - his is the decision of long term scheduler that how many processes will stay in the ready queue. Long term scheduler decides the degree of multiprogramming of system. It is the furthest away from the CPU

Medium term scheduler - during the execution of a process when a I/O operation is required then the operating system sends that process from running queue to waiting queue. When a process completes its I/O operation then it should again be shifted to ready queue. All these decisions are taken by the medium-term scheduler. It is 2nd in terms of distance from the CPU

Short term scheduler - When there are lots of processes in main memory initially all are present in the ready queue. Among all of the process, a single process is to be selected for execution. This decision is handled by short term scheduler. It is closest to the CPU

98
Q

What does a dispatcher do ?

A
  • Once the scheduler has selected a process from the queue, the dispatcher comes into the picture, and it is the dispatcher who takes that process from the ready queue and moves it into the running state. Or waiting state

It involves :
. Switching context
. Switching to user mode
. Jumping to the proper location in the user program to restart that program

99
Q

Name the scheduling criteria ?

A
  • CPU utilization: keep the CPU as busy as possible. We want to maximise this
  • Throughput: Number of processes that complete their execution per time unit. We want to maximise this
  • Turnaround time: amount of time to execute a particular process. We want to minimise this
  • Waiting time: amount of time a process has been waiting in the ready queue. We want to minimise this
  • Response time: amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment). We want to minimise this
100
Q

How do we calculate turnaround time

A

Exit time - Arrival time

101
Q

What is the formula for waiting time?

A

turnaround time - burst time

102
Q

What are the 6 scheduling algorithms?

A

1- First-Come, First-Served Scheduling (FCFS)
2- Shortest-Job-First Scheduling
3- Priority Scheduling
4- Round-Robin Scheduling
5- Multilevel Queue Scheduling
6- Multilevel Feedback Queue Scheduling

103
Q

Give some info on First come first serve (FCFS)

A
  • Works on a FIFO(first in first out) basis
  • It’s a non preemptive scheduling algorithm
  • Its easy to implement and use
    . It has poor performance and high waiting time
104
Q

Give some info on shortest job first(SJF)

A
  • The process with the shortest execution time should be selected for execution next.
  • SJF is optimal: it gives minimum average waiting time for a given set of processes.
  • The difficulty is knowing the length of the next CPU request
  • SJF can be preemptive and non preemptive. Think of preemptive as shortest remaining time(A Level)
    . Useful for batch type processing
105
Q

Give some info on priority scheduling ?

A
  • A priority number (integer) is associated with each process
  • The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority)
  • SJF is priority scheduling where priority is the inverse of predicted next CPU burst time
  • This algorithm is used for both non preemptive and preemptive scheduling
106
Q

Give some info on round robin scheduling

A

The round-robin (RR) scheduling algorithm is designed especially for time-sharing systems
* Each process gets a small unit of CPU time (time quantum or time slice), usually 10-100 milliseconds. After this time has passed, the process is preempted and added to the end of the ready queue.
* The ready queue is treated as a circular queue and FIFO queue of processes.
* The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum.
* No process is allocated the CPU for more than 1 time quantum in a row (unless it is the only runnable process).

		§ Large time quantum ⇒ FIFO
		§ Small time quantum small ⇒ Context switch overhead is too high
107
Q

What 2 things will happen in round robin?

A

. The process may have a CPU burst of less than 1 time quantum. In this case, the process itself will release the CPU voluntarily. The scheduler will then proceed to the next process in the ready queue.

. If the CPU burst of the currently running process is longer than 1 time quantum, the timer will go off and will cause an interrupt to the operating system. A context switch will be executed, and the process will be put at the tail of the ready queue. The CPU scheduler will then select the next process in the ready queue.

108
Q

Give some info on multi level queue scheduling ?

A
  • Ready queue is partitioned into separate queues, eg:
    -foreground (interactive) processes
    • background (batch) processes

These two types of processes have different response-time requirements and so may have different scheduling needs

* The processes are permanently assigned to one queue, generally based on some property of the process, such as memory size, process priority, or process type.
* Each queue has its own scheduling algorithm, eg:
  - foreground processes - RR 
 - Background process RR

* Scheduling must be done between the queues: Fixed priority scheduling; (i.e., serve all from foreground then from background).  Possibility of starvation. . No process in the other queue can executes
109
Q

Give some info on multi level feedback queue scheduling

A
  • A process can move between the various queues (processes are NOT permanently assigned to a queue); aging can be implemented this way.
    • Multilevel-feedback-queue scheduler defined by the following parameters:
      ○ The number of queues
      ○ The scheduling algorithms for each queue
      ○ The method used to determine when to upgrade a process
      ○ The method used to determine when to demote a process
      ○ The method used to determine which queue a process will enter when that process needs service
110
Q

Look at the ganartt charts and images for better explanation on the scheduling algorithms (Session 20-21)

A

111
Q

Look at the ganartt charts and images for better explanation on the scheduling algorithms (Session 20-21)

A