Pre-emptive & Cooperative, Single Multitasking Flashcards

1
Q

Single user, multi-tasking Introduction

A

Single user, multi-tasking

Although you have sole use of your PC while you are sitting at it, you are quite likely to want to do more than one thing at the same time.

You may want to print a document at the same time as you are continuing to edit another document with a word processor. You don’t want to wait until the computer has finished printing before you can type anything new with the keyboard!

Other examples of multi-tasking could be downloading a file from the World Wide Web (WWW) while editing a document, or playing an audio CD while working with a spreadsheet.

The solution is to let your PC’s processor run more than one program, or task, at the same time.

This is done by time slicing, in exactly the same way as different users are time sliced on a multi-user computer. The processor’s time is split between the different tasks, and they all appear to you to be running simultaneously. This is called pre-emptive multi-tasking, as processes have no say over when they run or are paused, and is used by all modern multi-tasking operating systems.

An alternative is co-operative multi-tasking, where a process is granted exclusive use of the processor until it decides it is ready to voluntarily suspend itself – usually while it is waiting for the user to press a key or move the mouse. This has advantage of simplicity but relies on programmers writing their processes properly.

It also makes it difficult to implement an effective priority system if one process is more urgent than others.

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

Pre-emptive multitasking

A

In computing, preemption is the act of temporarily interrupting a task being carried out by a computer system, without requiring its cooperation, and with the intention of resuming the task at a later time.

Such a change is known as a context switch. It is normally carried out by a privileged task or part of the system known as a pre-emptive scheduler, which has the power to pre-empt, or interrupt, and later resume, other tasks in the system.

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

Cooperative multitasking

A

Cooperative or non-preemptive multitasking is a style of computer multitasking in which the operating system never initiates a context switch from a running process to another process.

Such systems are either statically scheduled, most often periodic systems, or exhibit some form of cooperative multitasking, in which case the computational tasks can self-interrupt and voluntarily give control to other tasks. When non pre-emptive is used, a process that receives such resources cannot be interrupted until it is finished.

Thus, cooperative multitasking is a type of multitasking in which the process currently controlling the CPU must offer control to other processes. It is called “cooperative” because all programs must cooperate for it to work. In contrast, pre-emptive multitasking which interrupts applications and gives control to other processes outside of an application’s control.

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

Scheduling

A

In computing, scheduling is the method by which threads, processes or data flows are given access to system resources (e.g. processor time, communications bandwidth).

This is usually done to load balance and share system resources effectively or achieve a target quality of service.

The need for a scheduling algorithm arises from the requirement for most modern systems to perform multitasking (executing more than one process at a time) and multiplexing (transmit multiple data streams simultaneously across a single physical channel).

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

Process scheduler

A

The process scheduler is a part of the operating system that decides which process runs at a certain point in time. It usually has the ability to:

*Pause a running process
*Move it to the back of the running queue
*Start a new process;

Such a scheduler is known as pre-emptive scheduler; otherwise it is a cooperative scheduler.

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

Process scheduler cont.

A

Such a scheduler is known as preemptive scheduler; otherwise it is a cooperative scheduler.
The scheduler is concerned mainly with the throughput (the total number of processes that complete their execution per time unit (slot)), latency (specifically the turnaround time, as a total time between submission of a process and its completion, and the response time, as a time from submission of a process to the first time it is scheduled), fairness (equal CPU time to each process, or more generally appropriate times according to the priority and workload of each process), and waiting time (the time the process remains in the ready queue).

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

Memory Data Register or Memory Buffer Register (MDR or MBR)

A

The Memory Data Register or Memory Buffer Register (MDR or MBR) is the register of a computer’s control unit that contains the data to be stored in the computer storage (e.g. RAM), or the data after a fetch from the computer storage. It acts like a buffer and holds anything that is copied from the memory ready for the processor to use it.

The MDR is a two-way register. When data is fetched from memory and placed into the MDR, it is written to in one direction. When there is a write instruction, the data to be written is placed into the MDR from another CPU register, which then puts the data into memory.

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