IB Computer Science HL Topic 6: Resource Management

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/27

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

28 Terms

1
New cards

Policies

Multi-tasking OSs have to make decisions about how to use resources by the process of using policies.

Examples (in memory managment):
- Replace the page that has been in memory for the longest time.
- Replace the least recently used page.
- Replace the least frequently used page.

2
New cards

Scheduling

The method by which the OS decides which processes should be able to use which resources for when and how long.

The OS will try to keep all resources maximally utilized to avoid idle time.

The OS also tries to minimize delays or maximize the fairness in the use of resources.

3
New cards

Prioritization

The concept that some running processes can be treated as more important than others so that they get more CPU time.

4
New cards

Blocking

Blocking is a method by which a program can declare itself unable to proceed until some condition is met (i.e. until a resource is available).

I/O: user cannot proceed until input is provided.

A program that is waiting for I/O and
can't do anything until it arrives is said
to be blocked on I/O.

The OS detects this and swaps it out
of memory and gets on with other tasks.

How does it know when to swap it into memory again?
- Polling
- Interrupt

5
New cards

Swapping

A blocked process can be "swapped out" of memory by the OS and its state is saved to disk. When it is ready to be resumed, the OS can swap it back in and run it again. This ensures that memory will not be wasted.
Swapping → Linked to paging.

6
New cards

I/O

Input/Output (e.g. reading from or writing to disk, sending or receiving data on a network, etc)

It is slow because it is moving stuff in the physical world.

7
New cards

Multiple CPUs ("cores") e.g. dual core, quad core, graphics processor, etc

It is obvious that more CPUs will give greater processing power but an extra layer of complexity is introduced in deciding which core should be used when. Another idea is to dedicate resources to a particular function. -> Dedicated Operating Systems

Graphics is a common one with modern high-performance gaming computers dedicating extra CPUs and RAM for use by graphics cards alone.

8
New cards

Polling

If the piece of hardware cannot interrupt the CPU, then the CPU has to keep checking with the hardware, to see if it is finished.

Advantages:
- Easy to implement (no special hardware required).
- Polling gives the CPU more control over what it does.

Disadvantages:
- Polling wastes CPU time.

Note: Interrupts are used in almost all cases now, but polling can have better performance if:
- The CPU hasn't got anything else to do
- The result of the poll is very likely to be positive

9
New cards

Interrupt

An interrupt is a signal from hardware or software that stops the CPU and forces it to do something else immediately. The interrupt does this without waiting for the current program to finish. It is unconditional and immediate which is why it is called an interrupt. The whole point of a interrupt is that the main program can perform a task without worrying about an external event.

Advantage:
- Interrupts save the CPU time because the CPU doesn't need to keep checking constantly.

Disadvantage:
- Too many interrupts can cause the CPU to slow down.

Note: Almost all hardware will use interrupts where possible.

10
New cards

Buffer

A buffer allows the CPU to queue up a meaningful amount of work each time it communicates with a hardware device.

Related to queues -> FIFO structure

11
New cards

Direct Memory Access (DMA)

DMA, allows the hardware device to bypass the CPU and access RAM directly, to save or retrieve the data it needs

Advantage:
DMA is suitable when the I/O has a high transmission rate, e.g. Ethernet, and there would be too many interrupts otherwise

Note:
(An interrupt will still be used to notify the CPU that the peripheral has finished its task, but no interrupts will have been necessary during data transfer.)

12
New cards

Multi-user environments

The OS divides its time and resources up between users, just as it does between programs. Two users who are concurrently using machines, do not access or overwrite each other's memory space.

The OS must manage each user's data and memory space, as well as each process's data and memory space, to ensure that it is secure from access by other users or processes.

Multi-user environment: keeping the memory space (primary and secondary) of each user safe from other users

13
New cards

Multi-tasking

A set of strategies for sharing the CPU and doing multiple things at the same time is called multi-tasking.

Relates to concurrency - multi-tasking. Doing things sequentially is time-wasting.

Multi-tasking environment: keeping the memory space of each process safe from other running processes

14
New cards

Paging

Paging = Dividing virtual memory up into equal-sized blocks (pages)

Paging allows OSs to allocate non-contiguous chunks of memory to the same process, thus reducing fragmentation problems.

Advantage: reduces fragmentation.

Explanation: Allows running processes to be split across pages. This uses memory more effectively because unused areas of memory that would otherwise be too small to accommodate a process, can be used.

15
New cards

Virtual Memory

The use of secondary memory by the OS as if it were primary memory in order to allow more processes to run simultaneously than would normally be possible.
But if it has been idle for a while, the OS can save its state to the hard disk, freeing up memory for another process.
When necessary, it can read the process's state back off the disk and into RAM so that it can run again.
OS makes it easier for programs to reference memory because they don't need to worry about the complications of the underlying physical structure of memory and disk. ABSTRACTION

16
New cards

Fragmentation

The storing of a file in separate areas of memory scattered throughout a hard disk

17
New cards

Defragmentation

rewriting all these bits to order them -> helps to increase faster performance

18
New cards

OS (Single user, single task)

Early computers + Mobile phones

19
New cards

OS (Single user, multi-tasking)

A basic standalone home PC has one user who can run lots of different programs at the same time, e.g. Mac OS or Windows 7.

20
New cards

OS (Multi-user)

A network operating system, such as the one at school, in which multiple users can run multiple programs simultaneously, e.g. Windows Server 2012.

21
New cards

Dedicated Operating System

A dedicated operating system is designed to support a particular range of applications.
They may be optimized for these applications and for a particular set of hardware.
Examples are network operating systems, distributed operating systems and real-time operating systems (e.g. air-traffic control, medical/life-support).

22
New cards

Java Virtual Machine (JVM)

The JVM (Java Virtual Machine) is the program that compiles and runs Java programs. The Java program itself doesn't care which operating system it's on because it only interacts with the JVM. Once a JVM has been written for a particular OS, then any number of Java programs can be written. This is how Java achieves platform-independence.

23
New cards

Virtualization

Virtualization is the process of making a virtual rather than actual version of something. We usually use virtualization when the reality is rather complex and confusing. The virtual interface to something makes the reality seem uniform, thereby simplifying its use. ABSTRACTION AGAIN

Link to JVM:
Virtualization hides complexity from the user through abstraction, making it easier for the user to use. The JVM appears to be the same for each operating system but it is not. It must be rewritten to suit the OS.

Link to virtual memory:
Another example of virtualization is virtual memory, whereby secondary memory is used as if it were primary memory. The programs do not need to know how the data is transferred and thus abstraction is again used to simplify the complex processes surrounding the transfer of data into physical memory.

24
New cards

Proprietary

organized by a proprietor (a person to whom the king had made a grant of land)

25
New cards

drive letter

A letter of the alphabet assigned to a formatted partition or volume as a reference point for future access by the user or their applications.

26
New cards

Hardware Interface

an architecture used to connect two devices together; includes the design of the plug and socket, the type, number and purpose of the wires, and the electrical signals that are passed across them.

27
New cards

Memory Peripherals

Through the use of drivers (specially written, individualised) 'translation' programs, the other programs (and ultimately the user) can use and control peripheral devices (like a keyboard, mouse, printer, etc.)`

28
New cards

Folder structure

A hierarchical way of organising files and folders nesting sub-folders inside a root folder